README
staty
Build a proxy-state from plain objects
Install
$ npm install @geut/staty
Usage
import { staty, subscribe, snapshot } from '@geut/staty'
const state = staty({
count: 0
})
console.log(snapshot(state)) // { count: 0 }
subscribe(state, () => {
console.log(state) // { count: 1 }
})
subscribe(state, () => {
console.log(state.count) // 1
}, { filter: 'count' })
// filter multiple values
subscribe(state, () => {
console.log(state.count) // 1
}, { filter: ['count'] })
state.count++
Issues
:bug: If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.
Contributing
:busts_in_silhouette: Ideas and contributions to the project are welcome. You must follow this guideline.
License
MIT © A GEUT project