-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use stdweb spawn_local to execute futures #776
Comments
I realize this is different, but some may find it useful. I just tried using the https://docs.rs/wasm-bindgen-futures/0.4.5/wasm_bindgen_futures/fn.spawn_local.html |
Oh, interesting. Although it has since been removed and replaced with this stdweb based spawn_local in the yewtil crate, there are eventual plans to re-add a wasm-bindgen based implementation you could choose to use. This is more simple than the prior implementation, and should make gating either behind a feature flag much easier. |
With spawn_local(async move {
let branch = get_branch().await.unwrap_throw(); // vs unwrap?
branch_received.emit(branch);
}); |
Since the corresponding PR in the appropriate repo was merged, I think that this issue can be closed. |
Description
Allow to use
send_future
with cargo web and asmjs-unknown-emscripten target by using stdwebspawn_local
future feature.An example of using future with stdweb https://github.com/koute/stdweb/blob/master/examples/futures/src/main.rs
Context (Environment)
The text was updated successfully, but these errors were encountered: