@nuware/store
v0.3.1
Published
State container
Downloads
22
Readme
Store
Install
npm install @nuware/store --save
or
<script defer src="https://unpkg.com/@nuware/store@latest/dist/store.umd.js"></script>
or
<script defer src="https://unpkg.com/@nuware/store@latest/dist/store.min.js"></script>
Usage
Browser
const Store = window.nuware.Store
Node
const Store = require('@nuware/store')
or
import Store from '@nuware/store'
Initialize Store
const store = Store({
any: {
initial: {
state: true
}
}
})
API
Store
Factory function return the Store instance. You can pass the initial state of this Store.
store
Store instance.
store.ref()
store.VALUE_EVENT
store.CHILD_ADDED_EVENT
store.CHILD_CHANGED_EVENT
store.CHILD_REMOVED_EVENT
ref
ref.child()
ref.parent()
ref.get()
ref.set()
ref.remove()
ref.on()
ref.off()
Authors
- Dmitry Dudin [email protected]