2 ms·
This is what useReducer is for at its core isn’t it? You dispatch named type actions and it executed accordingly. Seems like that would work just as well for th
by no_wizard 6y ago
This is what useReducer is for at its core isn’t it? You dispatch named type actions and it executed accordingly. Seems like that would work just as well for this, honestly.
- tshaddox 6y agoA reducer is pretty close to a state machine. The main differences are that state machines generally prevent invalid transitions and have tooling to help you handle and visualize all the states and transitions.