# preact-scoped-model

> Scoped Model pattern in Preact (but with Hooks)

[![NPM](https://img.shields.io/npm/v/preact-scoped-model.svg)](https://www.npmjs.com/package/preact-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/preact-scoped-model)

## Features

- Contextual State: Inject state into your component tree.
- Composition: Write states as if you are writing components, use Preact Hooks to compose state logic.
- Granular control: Only watch updates you need, not when the whole state updates.

## Install

```bash
npm install --save preact-scoped-model
```

```bash
yarn add preact-scoped-model
```

## Documentation

- [Creating a model](/packages/preact-scoped-model/docs/create-model.md)
- [Scoped Model Hooks](/packages/preact-scoped-model/docs/hooks/README.md)
- [Model Factories](/packages/preact-scoped-model/docs/model-factory.md)
- [Hook Factories](/packages/preact-scoped-model/docs/hook-factory.md)

## License

MIT © [lxsmnsyc](https://github.com/lxsmnsyc)
