mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-30 17:01:06 +00:00
JS engines guarantee that at least one of our `then` callbacks are invoked, so that means if we destroy them prematurely they're guaranteed to log an exception to the console! Instead to prevent exceptions from happening tweak how the completion callbacks for JS futures are managed and ensure that the closures stay alive until they're invoked later. Closes #1637
wasm-bindgen-futures
This crate bridges the gap between a Rust Future
and a JavaScript
Promise
. It provides two conversions:
- From a JavaScript
Promise
into a RustFuture
. - From a Rust
Future
into a JavaScriptPromise
.
See the API documentation for more info.