mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-14 12:02:23 +03:00
88618116ac
This commit adds support to attach `#[wasm_bindgen]` on an `async fn` which will change the return value into a `Promise` in JS. This in theory has the exact same semantics as an `async` function in JS where you call it with all the arguments, nothing happens and you get a promise back, and then later the promise actually resolves. This commit also adds a helper trait, `IntoJsResult`, to allow `async` functions with multiple kinds of return values instead of requiring everything to be `Result<JsValue, JsValue>`. |
||
---|---|---|
.. | ||
add | ||
canvas | ||
char | ||
closures | ||
console_log | ||
dom | ||
duck-typed-interfaces | ||
fetch | ||
guide-supported-types-examples | ||
hello_world | ||
import_js | ||
julia_set | ||
paint | ||
performance | ||
raytrace-parallel | ||
request-animation-frame | ||
todomvc | ||
wasm2js | ||
wasm-in-wasm | ||
webaudio | ||
webgl | ||
websockets | ||
without-a-bundler | ||
without-a-bundler-no-modules | ||
.gitignore | ||
README.md |
Examples
This directory contains a number of Cargo projects that are all examples of how
to use wasm-bindgen
in various contexts. More documentation can be found
online