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

PropertyDescriptionTypeDefault
depsreactive data sourcesAccessor<S> | AccessorArray<S>-
fncallbackOnEffectFunction-
optionsoptionsOnOptions-