useWatchIgnorable
Watches for changes in the dependencies.
Calls the provided function when the dependencies change, and return a wrapper function to ignore the listening.
Examples
Basic Usage
Count:0
DoubleCount:0
Basic usage
Watches reactive data sources and invokes a callback function when the sources change, and return a wrapper function to ignore the listening
API
type IgnoreUpdateFn = (fn: () => any) => voidfunction useWatchIgnorable<S, Next extends Prev, Prev = Next>( deps: Accessor<S> | AccessorArray<S>, fn: OnEffectFunction<S, undefined | NoInfer<Prev>, Next>, options?: OnOptions & { defer?: false },): IgnoreUpdateFnfunction useWatchIgnorable<S, Next extends Prev, Prev = Next>( deps: Accessor<S> | AccessorArray<S>, fn: OnEffectFunction<S, undefined | NoInfer<Prev>, Next>, options: OnOptions | { defer: true },): IgnoreUpdateFn
type IgnoreUpdateFn = (fn: () => any) => voidfunction useWatchIgnorable<S, Next extends Prev, Prev = Next>( deps: Accessor<S> | AccessorArray<S>, fn: OnEffectFunction<S, undefined | NoInfer<Prev>, Next>, options?: OnOptions & { defer?: false },): IgnoreUpdateFnfunction useWatchIgnorable<S, Next extends Prev, Prev = Next>( deps: Accessor<S> | AccessorArray<S>, fn: OnEffectFunction<S, undefined | NoInfer<Prev>, Next>, options: OnOptions | { defer: true },): IgnoreUpdateFn
Params
| Property | Description | Type | Default |
|---|---|---|---|
| deps | reactive data sources | Accessor<S> | AccessorArray<S> | - |
| fn | callback | OnEffectFunction | - |
| options | options | OnOptions | - |