immediately<T> method
Watcher<T>
immediately<T>(
- SourcesFn<
T> sourcesFn, - WatcherFn<
T> fn, { - WhenFn<
T> ? when, - JoltDebugOption? debug,
Creates a watcher hook that executes immediately upon creation.
Parameters:
sourcesFn: Function that returns the values to watchfn: Callback function executed when sources changewhen: Optional condition function for custom trigger logicdebug: Optional debug options
Returns: A Watcher that executes immediately
Implementation
@defineHook
Watcher<T> immediately<T>(
SourcesFn<T> sourcesFn,
WatcherFn<T> fn, {
WhenFn<T>? when,
JoltDebugOption? debug,
}) {
return useHook(_UseWatcherHook<T>(sourcesFn, fn,
when: when, immediately: true, debug: debug));
}