F

onChange

Registers a callback invoked on every settings change matching the predicate.

function onChange(predicate: SettingsPredicate, callback: (payload: SettingsPayload) => void): () => void

Parameters

NameTypeDescription
predicateSettingsPredicate

Decides whether a given change should fire the callback. The payload names the Bucket in store.

callback(payload: SettingsPayload) => void

Invoked with the payload of each matching change.

Returns

() => void

A function that removes the listener.