stateful~ StatefulMixin

Contains methods that provide statefulness to an object which is passed to module:stateful.

Members

(static) state :Object

A hash containing arbitrary keys and values representing the state of the object.

Type:
  • Object

Methods

(static) setState(stateUpdates) → {Object|undefined}

Set the state of an object by mutating its state object in place.

Parameters:
NameTypeDescription
stateUpdatesObject | function

A new set of properties to shallow-merge into the plugin state. Can be a plain object or a function returning a plain object.

Returns:

An object containing changes that occurred. If no changes occurred, returns undefined.

Type: 
Object | undefined

Events

statechanged

An event triggered on an object that is both stateful and evented indicating that its state has changed.

Type:
  • Object
Properties
NameTypeDescription
changesObject

A hash containing the properties that were changed and the values they were changed from and to.