Proyectos
Ver en GitHub
bluebill1049/little-state-machine
Acerca de
📠 Hook personalizado de React para gestionar el estado persistente
Desarrollo web y de aplicacionesWhat you can do
- Tiny, with no runtime dependencies
- State persistence with session storage by default
- Selectors to limit re-renders
Crecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 0
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalSimple global state for React.
Get started | Documentation | Quickstart
Features
- Tiny, with no runtime dependencies
- State persistence with session storage by default
- Selectors to limit re-renders
Install
npm install little-state-machine
Quickstart
import { createStore, useStateMachine } from 'little-state-machine';
createStore({ count: 0 });
function increment(state) {
return { ...state, count: state.count + 1 };
}
function Counter() {
const { actions, state } = useStateMachine({ actions: { increment } });
return <button onClick={() => actions.increment()}>{state.count}</button>;
}
Read the documentation for options, selectors, and TypeScript setup.
Explorar proyectos relacionados
Cargando…