pub fn use_future_with_deps<'hook, F, D, T, O>(
    f: F,
    deps: D
) -> impl 'hook + Hook<Output = SuspensionResult<UseFutureHandle<O>>>where
    F: FnOnce(Rc<D>) -> T,
    T: Future<Output = O> + 'static,
    O: 'static,
    D: PartialEq + 'static,
    F: 'hook,
    D: 'hook,
    T: 'hook,
    O: 'hook,
Expand description

Use the result of an async computation with dependencies, suspending while waiting.

Awaits the future returned from f for the latest deps. Even if the future is immediately ready, the hook suspends at least once. If the dependencies change while a future is still pending, the result is never used. This guarantees that your component always sees up-to-date values while it is not suspended.

Note

When used in function components and hooks, this hook is equivalent to:

pub fn use_future_with_deps<F, D, T, O>(
    f: F,
    deps: D,
) -> SuspensionResult<UseFutureHandle<O>>
where
    F: FnOnce(Rc<D>) -> T,
    T: Future<Output = O> + 'static,
    O: 'static,
    D: PartialEq + 'static,
{
    /* implementation omitted */
}