You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -201,9 +201,7 @@ AsBind.instantiate: (
201
201
WebAssembly.Module|
202
202
BufferSource|
203
203
Response|
204
-
PromiseLike<WebAssembly.Module>|
205
-
BufferSource|
206
-
Response
204
+
PromiseLike<WebAssembly.Module>
207
205
),
208
206
imports?:WasmImports
209
207
) =>Promise<AsBindInstance>`
@@ -243,31 +241,31 @@ Each **exported function** has the property: `shouldCacheTypes`. If you would li
243
241
244
242
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.
245
243
246
-
#### importObject
244
+
##### importObject
247
245
248
246
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.
249
247
250
248
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.
251
249
252
250
##### enableExportFunctionTypeCaching
253
251
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.
255
253
256
254
##### disableExportFunctionTypeCaching
257
255
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.
259
257
260
258
##### enableImportFunctionTypeCaching
261
259
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.
263
261
264
-
##### disableExportFunctionTypeCaching
262
+
##### disableImportFunctionTypeCaching
265
263
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.
267
265
268
266
## Motivation
269
267
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:
271
269
272
270
- [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/).
0 commit comments