๐ Version 5.0.0
- Fine-tune the performance with partial render and selector
const selector = (state) => state.yourDetails.name.length > 10;
const { actions, state, getState } = useStateMachine<T>({
actions?: Record<string, Function> // Optional action to update global state
selector,
});
- Isolated re-render at
useStateMachine
usgae, no longer useContext
API
const App = () => (
- <StateMachineProvider>
<YourComponent />
- <StateMachineProvider>
);