Skip to main content

Function: useObservedProperty()

useObservedProperty<E, K, R>(events, key, getSnapshot, deps?): R

Defined in: coreUtils/hooks.ts:25

Subscribes to a value which changes are tracked by the specified event.

Type Parameters

Type Parameter

E

K extends string | number | symbol

R

Parameters

ParameterTypeDescription

events

Events<E>

an observable object to subscribe with the result store

key

K

event type from the events to subscribe with the result store

getSnapshot

() => R

a function to get a snapshot of an observed property state

deps?

DependencyList

hook dependency list to re-subscribe to the store on changes

Returns

R

See