Class: Store

Marbles. Store

new Store(id)

This class is meant to be sub-classed using Store.createClass
Parameters:
Name Type Description
id * Anything serializable as JSON
Source:

Members

(static) Store.dispatcherIndex

Properties:
Type Description
Number
Source:

Methods

(static) Store.addChangeListener(id)

Parameters:
Name Type Description
id Store#id
Source:

(static) Store.createClass(proto)

Creates a new class that inherits from Store
Parameters:
Name Type Description
proto Object Prototype of new child class
Source:
Example
var MyStore = Marbles.Store.createClass({
	displayName: "MyStore",

	getInitialState: function () {
		return { my: "state" };
	},

	willInitialize: function () {
		// do something
	},

	didInitialize: function () {
		// do something
	},

	didBecomeActive: function () {
		// do something
	},

	didBecomeInactive: function () {
		// do something
	},

	handleEvent: function (event) {
		// do something
	}
});

(static) Store.discardInstance(store)

Give Store instance up for garbage collection
Parameters:
Name Type Description
store Marbles.Store
Source:

(static) Store.expectChangeListener(id)

Force store to remain active until the next change listener is added
Parameters:
Name Type Description
id Store#id
Source:

(static) Store.registerWithDispatcher(dispatcher)

Parameters:
Name Type Description
dispatcher Marbles.Dispatcher
Source:

(static) Store.removeChangeListener(id)

Parameters:
Name Type Description
id Store#id
Source:

(static) Store.unexpectChangeListener(id)

Undo expectation from expectChangeListener
Parameters:
Name Type Description
id Store#id
Source:

didBecomeActive()

Called when first change listener is added
Source:

didBecomeInactive()

Called when last change listener is removed and when the instance is otherwise perceived as inactive
Source:

didInitialize()

Called after state is initialized
Source:

getInitialState() → {Object}

Source:
Returns:
Initial state object
Type
Object

handleEvent(event)

Called with Dispatcher events
Parameters:
Name Type Description
event Object
Source:

willInitialize()

Called before state is initialized
Source: