Skip to main content

Function: useEventStore()

useEventStore<E, K>(events, key, deps?): SyncStore

Defined in: coreUtils/hooks.ts:55

Creates an event store which changes when an event triggers with the specified event type.

Type Parameters

Type Parameter

E

K extends string | number | symbol

Parameters

ParameterTypeDescription

events

undefined | Events<E>

an observable object to subscribe with the result store

key

K

event type from the events to subscribe with the result store

deps?

DependencyList

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

Returns

SyncStore