ํ๋ก์ ํธ
GitHub์์ ๋ณด๊ธฐ
bluebill1049/little-state-machine
์๊ฐ
๐ ์ํ๋ฅผ ์์์ ์ผ๋ก ๊ด๋ฆฌํ๋ React ์ปค์คํ ํ
์น ๋ฐ ์ฑ ๊ฐ๋ฐWhat you can do
- Tiny, with no runtime dependencies
- State persistence with session storage by default
- Selectors to limit re-renders
์ธก์ ๋ ์คํ ์ฆ๊ฐ
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 0
์๋ก ๊ฒน์น๋ ๊ธฐ๊ฐ์ ์์ฆ๊ฐ๋์ด๋ฉฐ ์ผ๋ณ ํฉ๊ณ๊ฐ ์๋๋๋ค. ์ธก์ ๊ฐ์ด ์์ผ๋ฉด ๋น์ ๋ก๋๋ค. ์คํ๋ ๊ด์ฌ๋๋ฅผ ๋ํ๋ด๋ฉฐ ํ์ง์ ๋ณด์ฅํ์ง ์์ต๋๋ค.
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.
๊ด๋ จ ํ๋ก์ ํธ ์ดํด๋ณด๊ธฐ
๋ถ๋ฌ์ค๋ ์คโฆ