pub fn use_interval<N>(
interval: N,
) -> UseIntervalReturn<impl Fn() + Clone + Send + Sync, impl Fn() + Clone + Send + Sync, impl Fn() + Clone + Send + Sync>
Expand description
Reactive counter increases on every interval.
§Demo
§Usage
let UseIntervalReturn {
counter,
reset,
is_active,
pause,
resume
} = use_interval( 200 );
§SendWrapped Return
The returned closures pause
, resume
and reset
are sendwrapped functions. They can
only be called from the same thread that called use_intersection_observer
.
§Server-Side Rendering
On the server this function will simply be ignored.