- Preparing search index...
- The search index is not available
statebot
Function useStatebotFactory
- useStatebotFactory(name: string, config: TStatebotOptions & { onTransitions?: any; performTransitions?: any }): { bot: TStatebotFsm; state: string }
-
Parameters
-
name: string
-
config: TStatebotOptions & { onTransitions?: any; performTransitions?: any }
Returns { bot: TStatebotFsm; state: string }
For Statebots whose life-cycles are tied to the components using them,
useStatebotFactory
:Example
Returns
The current state of the machine and the machine itself.