# dahlia-store

> State management for Dahlia

Latest version **1.4.0** (published 2019-08-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install dahlia-store
pnpm add dahlia-store
yarn add dahlia-store
bun add dahlia-store
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2019-08-01 |
| First published | 2019-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 17.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | forsigner |
| Maintainers | forsigner |

## Links

- npm: https://www.npmjs.com/package/dahlia-store
- Repository: https://github.com/forsigner/dahlia
- Homepage: https://github.com/forsigner/dahlia/blob/master/packages/dahlia-store/README.md
- Issues: https://.com/forsigner/dahlia/issues
- npm.io page: https://npm.io/package/dahlia-store

## Dependencies (3)

- [fast-deep-equal](https://npm.io/package/fast-deep-equal.md) ^2.0.1
- [lodash.debounce](https://npm.io/package/lodash.debounce.md) ^4.0.8
- [dahlia-observable](https://npm.io/package/dahlia-observable.md) ^1.2.0

## Recent versions

- 1.4.0 (latest) — 2019-08-01
- 1.3.5 — 2019-07-11
- 1.3.4 — 2019-07-02
- 1.3.3 — 2019-07-02
- 1.3.2 — 2019-07-01
- 1.3.1 — 2019-06-17
- 1.3.0 — 2019-06-11
- 1.2.20 — 2019-04-24
- 1.2.19 — 2019-04-22
- 1.2.18 — 2019-04-22
- 1.2.16 — 2019-04-19
- 1.2.15 — 2019-04-10
- 1.2.14 — 2019-03-25
- 1.2.13 — 2019-03-22
- 1.2.12 — 2019-03-22
- … 22 more at https://npm.io/package/dahlia-store/versions

## README

# dahlia-store

> State management for Dahlia

## Installation

```sh
yarn add dahlia-store
```

## Quick Start

```js
import React from 'react'

import { createStore, observe } from 'dahlia-store'

const store = createStore({
  count: 1,
  increment() {
    store.count++
  },
  decrement() {
    store.count--
  },
  async asyncIncrement() {
    await new Promise(resolve => setTimeout(resolve, 1000))
    store.count++
  },
})

const App = observe(() => (
  <div>
    <span>{store.count}</span>
    <button onClick={store.decrement}>-</button>
    <button onClick={store.increment}>+</button>
    <button onClick={store.asyncIncrement}>async+</button>
  </div>
))

ReactDOM.render(<App />, document.getElementById('root'))
```

## License

[MIT License](https://github.com/forsigner/dahlia/blob/master/LICENSE)

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