Implement WasmBindgen executor and reorganize

This commit is contained in:
Héctor Ramón Jiménez 2020-01-20 05:43:09 +01:00
parent 90690702e1
commit 04086a90c9
11 changed files with 176 additions and 110 deletions

View file

@ -0,0 +1,17 @@
use crate::Executor;
#[derive(Debug)]
pub struct WasmBindgen;
impl Executor for WasmBindgen {
fn new() -> Result<Self, futures::io::Error> {
Ok(Self)
}
fn spawn(
&self,
future: impl futures::Future<Output = ()> + Send + 'static,
) {
wasm_bindgen_futures::spawn_local(future);
}
}