cassiozen / useStateMachine

The <1 kb state machine hook for React
MIT License
2.38k stars 47 forks source link

matches function on state prototype #44

Open cassiozen opened 3 years ago

cassiozen commented 3 years ago

Right now the state value is always a string, but since we plan to introduce hierarchical fsms in the future (#21), state values might be represented differently.

Adding a 'matches' function on the machine state prototype (like XState) will give users a consistent and easy way to derive ui from the machine state.