프로젝트
GitHub에서 보기
mobxjs/mobx-examples
소개
A collection of simple mobx examples
학습 및 교육측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalMobX Examples
Modern MobX 6 examples using TypeScript and Vite. Each example is a self-contained project that can be opened directly in CodeSandbox.
Examples
| # | Example | Concepts | Open |
|---|---|---|---|
| 01 | Observable & Autorun | makeAutoObservable, autorun, dependency tracking |
CodeSandbox |
| 02 | Computed | computed getters, caching, lazy evaluation |
CodeSandbox |
| 03 | Actions | configure({ enforceActions }), action, batching |
CodeSandbox |
| 04 | runInAction | runInAction, async patterns |
CodeSandbox |
| 05 | Reaction | reaction, data vs effect functions, disposal |
CodeSandbox |
| 06 | When | when callback + promise form |
CodeSandbox |
| 07 | Observable Map | observable.map, dynamic keys |
CodeSandbox |
| 08 | Observable Array | Observable arrays, proxy behavior | CodeSandbox |
| 09 | React Todo | observer, mobx-react-lite, store + React Context |
CodeSandbox |
| 10 | React Timer | observer, computed, interval side effects |
CodeSandbox |
Running locally
Each example is a standalone Vite project:
cd examples/01-observable-autorun
npm install
npm run dev
MobX 3 to 6 migration reference
| MobX 3 (old) | MobX 6 (new) |
|---|---|
mobx.observable({...}) + factory functions |
class + makeAutoObservable(this) |
mobx.extendObservable(this, {...}) |
makeAutoObservable(this) |
mobx.useStrict(true) |
configure({ enforceActions: "always" }) |
mobx.whyRun() |
Removed |
React.createClass + mobxReact.observer() |
observer(FunctionComponent) from mobx-react-lite |
mobxReact.Provider + inject() |
React Context + useContext() |
License
MIT
관련 프로젝트 살펴보기
불러오는 중…