Skip to main content

Type Alias: KeyedSyncStore()<K, Context>

KeyedSyncStore<K, Context>: (key, context, onStoreChange) => () => void

Represents a per-key event store which can be subscribed to listen its changes.

This store is similar to one accepted by React.useSyncEventStore hook but accepted by useKeyedSyncStore instead.

Arbitrary context value can be made required by the store which is captured on the initial subscription and its changes does not force a re-subscription.

Type Parameters

Type Parameter

K

Context

Parameters

ParameterType

key

K

context

Context

onStoreChange

() => void

Returns

Function

Returns

void

See

useKeyedSyncStore

Defined in

coreUtils/keyedObserver.ts:62