@nuware/store

State container

Stats

StarsIssuesVersionUpdatedCreatedSize
@nuware/store
000.3.13 years ago4 years agoMinified + gzip package size for @nuware/store in KB

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

License

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.