Function use_throttle_effect_with_deps

Source
pub fn use_throttle_effect_with_deps<'hook, Callback, Dependents>(
    callback: Callback,
    millis: u32,
    deps: Dependents,
) -> impl 'hook + Hook<Output = ()>
where Callback: FnMut() + 'static + 'hook, Dependents: PartialEq + 'static + 'hook,
Expand description

This hook is similar to use_throttle_effect but it accepts dependencies.

Whenever the dependencies are changed, the throttle effect is run again. To detect changes, dependencies must implement PartialEq.

ยงNote

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

pub fn use_throttle_effect_with_deps<Callback, Dependents>(
    callback: Callback,
    millis: u32,
    deps: Dependents,
)
where
    Callback: FnMut() + 'static,
    Dependents: PartialEq + 'static,
{
    /* implementation omitted */
}
OSZAR »