tiny-store

1.0.0 • Public • Published

tiny-store

Tiny immutable store for any value

Install

npm install tiny-store

Use

// 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' }

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i tiny-store

Weekly Downloads

1

Version

1.0.0

License

none

Last publish

Collaborators

  • crazytoucan