@state-management/state-machine-react
Version:
React wrapper for simple-state-machine, provides fromState and useDispatcher hooks and unit test fixtures
8 lines (7 loc) • 300 B
TypeScript
import { Command } from '@state-management/simple-state-machine';
/**
* Custom hook for dispatching commands in the state machine.
* @returns A function to dispatch commands to the state machine.
*/
declare function useDispatcher<T>(): (command: Command<T>) => void;
export default useDispatcher;