Skip to main content

spawn

Function spawn 

Source
pub fn spawn<F>(future: F)
where F: Future<Output = ()> + 'static,
Expand description

Runs the provided future.

This can be used to fetch resources or perform any operation like reding the local storage.

The future runs after the DOM has loaded, so state changes will be reflected in the UI.

The given future is guaranteed to run after the current render cycle is complete.

Important: The provided future will run until the end even if the scope which started it was already replaced. So if scoped signals are read / updated after the scope and therefore signals are removed the whole application crashes.