ankurah-core 0.5.0

Core state management functionality for Ankurah
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::future::Future;

#[cfg(not(target_arch = "wasm32"))]
/// Spawn a task
pub fn spawn<F>(future: F)
where
    F: Future + Send + 'static,
    <F as futures::Future>::Output: std::marker::Send,
{
    tokio::spawn(future);
}

#[cfg(target_arch = "wasm32")]
pub fn spawn<F>(future: F)
where F: Future<Output = ()> + Send + 'static {
    wasm_bindgen_futures::spawn_local(future);
}