Options that can be passed to syncWatch.

interface WatchOptions<T> {
    equal?: EqualsFunc<T>;
    immediate?: boolean;
}

Type Parameters

  • T

Properties

Properties

equal?: EqualsFunc<T>

A function that returns true if the two values are considered equal. If this function is provided, the watch callback will only be triggered if this function returns false.

By default, an implementation based on object identity is used.

immediate?: boolean

Whether to call the watch callback once during setup (default: false).

If this is false, the watch callback will only be invoked after at least a single value changed.

If this is true, the callback will fire immediately.