Mixin: State

Marbles. State

Manages a state object. You must define `state` {Object} and `__changeListeners` {Array} on the object this is mixed into.
Source:

Methods

(static) addChangeListener(handler)

Parameters:
Name Type Description
handler function Function to call when the state object changes
Source:

(static) didUpdate()

Called after state object is mutated
Source:

(static) removeChangeListener(handler)

Prevents handler from being called for future changes
Parameters:
Name Type Description
handler function
Source:

(static) replaceState(newState)

Replaces the existing state object with newState
Parameters:
Name Type Description
newState Object
Source:

(static) setState(newState)

Copies properties of newState to the existing state object
Parameters:
Name Type Description
newState Object
Source:

(static) willUpdate()

Called before state object is mutated
Source: