Skip to content
المشاريع

حول

خطاف 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.

npm downloads npm License

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.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…