# tiny-store

> Tiny immutable store for any value

Latest version **1.0.0** (published 2016-07-01) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-07-01 |
| First published | 2016-07-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Matthew Mueller |
| Maintainers | mattmueller |
| Keywords | store, immutable |

## Links

- npm: https://www.npmjs.com/package/tiny-store
- Repository: https://github.com/MatthewMueller/tiny-store
- Homepage: https://github.com/MatthewMueller/tiny-store#readme
- Issues: https://github.com/MatthewMueller/tiny-store/issues
- npm.io page: https://npm.io/package/tiny-store

## Dependencies (1)

- [component-clone](https://npm.io/package/component-clone.md) 0.2.2

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-07-01

## README

# tiny-store

  Tiny immutable store for any value

## Install

```
npm install tiny-store
```

## Use

```js
let store = require('tiny-store')

// create a fruit
let data = { fruit: 'apple' }
apple = store(data)

// try & change FAIL
console.log(apple()) // { fruit: 'apple' }
apple().fruit = 'pear'
console.log(apple()) // { fruit: 'apple' }
data.fruit = 'orange'
console.log(apple()) // { fruit: 'apple' }

// update
let grape = apple({ fruit: 'grape' })
console.log(grape()) // { fruit: 'grape' }
console.log(apple()) // { fruit: 'apple' }
```

## Implementation Notes

This uses a recursive `Object.freeze` under the hood. It's turned off in production (`process.env.NODE_ENV === 'production'`).

If you `use strict` at top of your JS, the script will throw at runtime if you try and make changes like this: `apple().fruit = "pear"`.

## License

MIT

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