Skip to main content

foundation-store.abstractstore.createlistener

Home > @genesislcap/foundation-store > AbstractStore > createListener

AbstractStore.createListener property

Creates an event listener.

Signature:

protected createListener: <TDetail = void>(keys: KeyOrKeys<TEventDetailMap & TInternalEventDetailMap>, token: (detail: TDetail, event?: CustomEvent<TDetail>) => void) => EventListener;

Remarks

You can think of this like a reducer in the redux sense. You are allowed to commit values to the store in these synchronous handlers.