المشاريع
عرض على GitHub
bluebill1049/little-state-machine
حول
خطاف React مخصص لإدارة الحالة مع حفظها واستعادتها.
تطوير الويب والتطبيقاتما يمكنك فعله
- Tiny, with no runtime dependencies
- State persistence with session storage by default
- Selectors to limit re-renders
النمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- ٠
- خلال 15 يومًا
- ٠
- خلال شهر
- ٠
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلSimple 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.
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…