Skip to main content

resource

Function resource 

Source
pub fn resource<K, T, E, F>(
    owner: &OwnerHandle,
    key: impl Fn() -> Option<K> + 'static,
    load: impl Fn(K, CancellationToken) -> F + 'static,
) -> Resource<K, T, E>
where K: Clone + PartialEq + 'static, T: 'static, E: 'static, F: Future<Output = Result<T, E>> + 'static,
Expand description

Create a Resource whose loads run with wasm_bindgen_futures::spawn_local.