This is a prerelease version of FAST (3.0.0-rc.1).

@microsoft/fast-element > watch

watch() function

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Deeply subscribes to changes in existing observable objects.

Signature:

export declare function watch(object: any, subscriber: Subscriber | ((subject: any, args: any) => void)): Disposable;

Parameters

Parameter

Type

Description

object

any

The observable object to watch.

subscriber

Subscriber | ((subject: any, args: any) => void)

The handler to call when changes are made to the object.

Returns:

Disposable

A disposable that can be used to unsubscribe from change updates.