# preact-scoped-model

> Scoped Model pattern for Preact

Latest version **3.0.0** (published 2022-05-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install preact-scoped-model
pnpm add preact-scoped-model
yarn add preact-scoped-model
bun add preact-scoped-model
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2022-05-22 |
| First published | 2020-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 343.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Alexis Munsayac |
| Maintainers | lxsmnsyc |
| Keywords | scoped-model, preact-scoped-model, provider, context, preact context, selector, state management, preact |

## Links

- npm: https://www.npmjs.com/package/preact-scoped-model
- Repository: https://github.com/LXSMNSYC/scoped-model
- Homepage: https://github.com/LXSMNSYC/scoped-model/tree/master/packages/preact-scoped-model
- Issues: https://github.com/LXSMNSYC/scoped-model/issues
- npm.io page: https://npm.io/package/preact-scoped-model

## Dependencies (1)

- [@lyonph/preact-hooks](https://npm.io/package/@lyonph/preact-hooks.md) ^0.5.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2022-05-22
- 0.5.1-alpha.11 (canary) — 2020-12-14
- 2.0.7 — 2021-08-29
- 2.0.5 — 2021-06-15
- 2.0.4 — 2021-05-06
- 2.0.3 — 2021-04-30
- 2.0.2 — 2021-04-04
- 2.0.1 — 2021-04-04
- 2.0.0 — 2021-04-04
- 0.7.0 — 2021-03-20
- 0.6.4 — 2021-03-17
- 0.6.3 — 2020-12-23
- 0.6.2 — 2020-12-19
- 0.6.0 — 2020-12-14
- 0.5.1-alpha.9 — 2020-12-11
- … 13 more at https://npm.io/package/preact-scoped-model/versions

## README

# 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)

---
_Source: https://npm.io/package/preact-scoped-model · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
