Class: Store

@aofl/store~ Store

Simple yet powerful implementation of flux type data store.

new Store(debug)

Creates an instance of Store.
Parameters:
Name Type Default Description
debug Boolean false
Source:

Methods


addState(sdo)

Parameters:
Name Type Description
sdo SDO
Source:

commit()

Copies staged changes to state and notifies subscribers
Source:

dispatch()

Batches all calls to dispatch and notifies subscribers on next tick.
Source:

flushState()

Resets the state to the initial state of Sdos.
Source:

getState()

getState() return the current state.
Source:
Returns:
Type
Object

replaceState(state)

replaceState() take a state object, replaces the state property and notifies subscribers.
Parameters:
Name Type Description
state Object
Source:

subscribe(callback)

subscribe() register the callback function with registerCallback and returns the unsubscribe function.
Parameters:
Name Type Description
callback Furtion
Source:
Returns:
Type
function