state-machine-lib
v1.0.16
Published
This is an NPM package to manage react state by state machine pattern
Downloads
21
Readme
state-machine-lib
A ReactJS hook to manage state machine
How to use it?
You can use the project in this way:
Install
# with npm
npm install state-machine-lib
Usage
- Import the package in your app:
import { useStateMachine } from "state-machine-lib";
- Get the state machine and transition from the hook:
const { transition, machineState } = useStateMachine(initialState, stateMachineConfiguration);
Github repo: state-machine-implementation
Implementation: Web page example