Skip to content

Commit 4bdf66d

Browse files
authored
Merge pull request #38 from tylervipond/fix-function-name-in-readme
updated readme with corrected function name and more
2 parents 9512800 + 711b66f commit 4bdf66d

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ AsBind.instantiate: (
201201
WebAssembly.Module |
202202
BufferSource |
203203
Response |
204-
PromiseLike<WebAssembly.Module> |
205-
BufferSource |
206-
Response
204+
PromiseLike<WebAssembly.Module>
207205
),
208206
imports?: WasmImports
209207
) => Promise<AsBindInstance>`
@@ -243,31 +241,31 @@ Each **exported function** has the property: `shouldCacheTypes`. If you would li
243241
244242
This is essentially the same as the [WebAssembly.Instance.prototype.exports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance/exports), this is an object containing all of the exported fields from the WebAssembly module. These are not bound / wrapped, so you can access the original exported functions.
245243
246-
#### importObject
244+
##### importObject
247245
248246
Similar to to [WebAssembly.instantiateStreaming() importObject](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming), This is the original passed importObject on instantiation, after the **importObject functions** are bound / wrapped by as-bind.
249247
250248
Each wrapped **importObject function** has the property: `shouldCacheTypes`. If you would like to disable type caching (speculative execution) for a particular function, you can do: `asBindInstance.importObject.myFunction.shouldCacheTypes = false;`. Or set to true, to re-enable type caching.
251249
252250
##### enableExportFunctionTypeCaching
253251
254-
This will (re-)enable type caching (speculative execution) for ALL exported functions on the AsBindInstance.
252+
Calling this method will (re-)enable type caching (speculative execution) for ALL exported functions on the AsBindInstance.
255253
256254
##### disableExportFunctionTypeCaching
257255
258-
This will disable type caching (speculative execution) for ALL exported functions on the AsBindInstance.
256+
Calling this method will disable type caching (speculative execution) for ALL exported functions on the AsBindInstance.
259257
260258
##### enableImportFunctionTypeCaching
261259
262-
This will (re-)enable type caching (speculative execution) for ALL importObject functions on the AsBindInstance.
260+
Calling this method will (re-)enable type caching (speculative execution) for ALL importObject functions on the AsBindInstance.
263261
264-
##### disableExportFunctionTypeCaching
262+
##### disableImportFunctionTypeCaching
265263
266-
This will disable type caching (speculative execution) for ALL importObject functions on the AsBindInstance.
264+
Calling this method will disable type caching (speculative execution) for ALL importObject functions on the AsBindInstance.
267265
268266
## Motivation
269267
270-
This library was inspired by several chats I had with some awesome buddies of mine in the WebAssembly Communitty:
268+
This library was inspired by several chats I had with some awesome buddies of mine in the WebAssembly Community:
271269
272270
- [Till Schneidereit](https://twitter.com/tschneidereit) and I had a chat about [WasmBoy](https://github.com/torch2424/wasmboy), and about how I had a really good experience writing the emulator, even though I had to do my own memory management. But they helped me realize, building something low level isn't that bad with manual memory management, but building something like a markdown parser would be very tedious since you have to manually write the string back and forth. Which then inspired this library, and its [markdown parser demo](https://torch2424.github.io/as-bind/).
273271

0 commit comments

Comments
 (0)