Skip to content

@yantrix/react v0.5.2 • Docs


Yantrix API / @yantrix/react / IYantrixBoundStore

Interface: IYantrixBoundStore<Snapshot> ​

External store bound to a single FSM instance. Used internally by useFSM.

Type Parameters ​

• Snapshot = TAutomata

Properties ​

callbacks ​

ts
callbacks: Map<number, TListenerCallback>;

callbacksIdCounter ​

ts
callbacksIdCounter: number;

changeState() ​

ts
changeState: () => void;

Returns ​

void


getSnapshot() ​

ts
getSnapshot: () => Snapshot;

Returns ​

Snapshot


subscribe() ​

ts
subscribe: (listener) => IUnsubscribe;

Parameters ​

• listener: TListenerCallback

Returns ​

IUnsubscribe