Skip to navigation

WatchOptions (interface)

Web SDK v5 API reference
View as Markdown

Watchable

Methods

Properties

Methods

guard

guard(newValue: T, oldValue: T): boolean

A function that returns a boolean to determine if the callback should be called. The guard not set by default.

Optional.

Since: 5.1.0

Parameters

ParameterTypeRequirementDescription
newValueTRequired
oldValueTRequired

Returns: boolean

Properties

clearable

clearable?: boolean

Whether the callback should be removed after calling the clear method. The default value is true.

Optional.

immediate

immediate?: boolean

Whether the callback should be called immediately after being added. The default value is false.

Optional.

Since: 5.1.0

once

once?: boolean

Whether the callback should be called only once. The default value is false.

Optional.

signal

signal?: AbortSignal

An AbortSignal. The watch callback will be removed when the abort() method of the AbortController which owns the AbortSignal is called. See AbortController for details.

Optional.

Since: 5.1.0