Skip to content

@yantrix/react v0.5.2 • Docs


Yantrix API / @yantrix/react / useFSMWithSelector

Function: useFSMWithSelector() ​

ts
function useFSMWithSelector<Selection, TContext>(inst, options): TUseFsmReturnWithSelection<Selection, TContext>

Like useFSM but derives a selection via a selector function. Re-renders only when the selection changes (shallow or custom equality).

Type Parameters ​

• Selection

• TContext = any

Parameters ​

• inst: TAutomata

• options: TUseFSMOptions<TAutomata, Selection>

Returns ​

TUseFsmReturnWithSelection<Selection, TContext>