UNPKG

react-scoped-model

Version:
34 lines (22 loc) 1.33 kB
# react-scoped-model > Scoped Model pattern in React (but with Hooks) [![NPM](https://img.shields.io/npm/v/react-scoped-model.svg)](https://www.npmjs.com/package/react-scoped-model) [![JavaScript Style Guide](https://badgen.net/badge/code%20style/airbnb/ff5a5f?icon=airbnb)](https://github.com/airbnb/javascript)[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat-square&logo=codesandbox)](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)