sycamore::web

Function create_client_resource

pub fn create_client_resource<F, Fut, T>(f: F) -> Resource<T>
where F: FnMut() -> Fut + 'static, Fut: Future<Output = T> + 'static, T: 'static,
Expand description

Create a resrouce that will only be resolved on the client side.

If the resource has any dependencies, it is recommended to use on to make them explicit. This will ensure that the dependencies are tracked since reactive variables inside async contexts are not tracked automatically.

On the server, the resource will always be marked as loading.