Function dioxus_fullstack::prelude::use_server_future
source · pub fn use_server_future<T, F, D>(
cx: &ScopeState,
dependencies: D,
future: impl FnOnce(D::Out) -> F
) -> Option<&UseServerFuture<T>>where
T: 'static + Serialize + DeserializeOwned + Debug,
F: Future<Output = T> + 'static,
D: UseFutureDep,Expand description
A future that resolves to a value.
This runs the future only once - though the future may be regenerated
through the [UseServerFuture::restart] method.
This is commonly used for components that cannot be rendered until some asynchronous operation has completed.
Whenever the hooks dependencies change, the future will be re-evaluated. If a future is pending when the dependencies change, the previous future will be allowed to continue
- dependencies: a tuple of references to values that are PartialEq + Clone