react-scoped-model
Version:
Scoped Model pattern in React (but with Hooks)
34 lines (22 loc) • 1.33 kB
Markdown
# react-scoped-model
> Scoped Model pattern in React (but with Hooks)
[](https://www.npmjs.com/package/react-scoped-model) [](https://github.com/airbnb/javascript)[](https://codesandbox.io/s/github/LXSMNSYC/scoped-model/tree/master/examples/react-scoped-model)
## Features
- Contextual State: Inject state into your component tree.
- Composition: Write states as if you are writing components, use React Hooks to compose state logic.
- Granular control: Only watch updates you need, not when the whole state updates.
## Install
```bash
npm install --save react-scoped-model
```
```bash
yarn add react-scoped-model
```
## Documentation
- [Creating a model](/packages/react-scoped-model/docs/create-model.md)
- [Scoped Model Hooks](/packages/react-scoped-model/docs/hooks/README.md)
- [Model Factories](/packages/react-scoped-model/docs/model-factory.md)
- [Hook Factories](/packages/react-scoped-model/docs/hook-factory.md)
- [Migrating from 0.16](/packages/react-scoped-model/docs/migrating.md)
## License
MIT © [lxsmnsyc](https://github.com/lxsmnsyc)