1.4.0-beta • Published 6 years ago

simple-global-store v1.4.0-beta

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Simple Global Store

Install

yarn add simple-global-store

or

npm install --save simple-global-store

Usage

import store from 'simple-global-store'

You have the following methods available on the store.

.initialize(data)

Allows you to set the initial data.

.data

Is the state of the store

.addChangeListener(callback)

Adds a change listener to the store which will be notified whenever any change is done to the store.

.removeChangeListener(callback)

Removes the change listener from further change notifications.

.update(data)

Updates the data to the current store data. Will add the data if the key to the object does not exist, overrides otherwise. It expects a object.

.clear()

Sets the store data to an empty object {}.

1.4.0-beta

6 years ago

1.3.1-beta

6 years ago

1.3.0-beta

6 years ago

1.2.0-beta

6 years ago

1.1.1-beta

6 years ago

1.1.0-beta

6 years ago

1.0.0-beta

6 years ago