# @bpeak/store

> > Store is a simple state-based event emitter

Latest version **1.0.7** (published 2020-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bpeak/store
pnpm add @bpeak/store
yarn add @bpeak/store
bun add @bpeak/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.0.7 |
| Published | 2020-07-16 |
| First published | 2020-06-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 107.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bpeak |

## Links

- npm: https://www.npmjs.com/package/@bpeak/store
- npm.io page: https://npm.io/package/@bpeak/store

## Recent versions

- 1.0.7 (latest) — 2020-07-16
- 1.0.6 — 2020-07-16
- 1.0.5 — 2020-07-16
- 1.0.4 — 2020-06-23
- 1.0.3 — 2020-06-23
- 1.0.2 — 2020-06-23
- 1.0.1 — 2020-06-22
- 1.0.0 — 2020-06-18

## README

# Store
> Store is a simple state-based event emitter

## Example
```js
const store = new Store({
	names: ['kihyun', 'jihyung'],
    isMenuOpen: false,
})

store.on('names', () => {
    console.log(`names changed: ${store.get().names}`)
})

store.on('isMenuOpen', () => {
    console.log(`isMenuOpen changed: ${store.get().isMenuOpen}`)
})

store.set({
    names: ['kihyun', 'jihyung', 'iksu', 'dongeun'],
    isMenuOpen: true
})
```

```
>> output
names changed: ['kihyun', 'jihyung', 'iksu', 'dongeun']
isMenuOpen changed: true
```

## Installation
```
npm install @bpeak/store
```
```js
const Store = require('@bpeak/store');
const store = new Store();
```

## UMD
```html
<script src="https://unpkg.com/@bpeak/store"></script>
<script>
    const store = new Store();
</script>
```

## ESM
```html
<script type="module">
    import Store from 'https://unpkg.com/@bpeak/store/dist/index.esm.js'
    const store = new Store();
</script>
```

## API

## Licence
MIT

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