Store
A simple Store which receive all state changes with an event (string).
Constructor Summary
Public Constructor | ||
public |
constructor(initialeState: object) The constructor. |
Member Summary
Public Members | ||
public |
Don't touch :) |
|
public |
Don't touch :) |
|
public |
The state of store. |
|
public |
Don't touch :) |
Method Summary
Public Methods | ||
public |
subscribe(event: string, callback: function(event: string, state: object, oldState: object), component: Component): number Method to call to subscribe to an event. |
|
public |
Unsubcribe all subcribers. |
|
public |
unsubscribeByEventAndId(event: string, id: number) Unsubscribe. |
|
public |
unsubsribe(id: number) Unsubscribe. |
|
public |
updateState(newState: object, events: ...string) Method to call to change the state. |
Public Constructors
Public Members
Public Methods
public subscribe(event: string, callback: function(event: string, state: object, oldState: object), component: Component): number source
Method to call to subscribe to an event.
There is a special event that catches all events : '*'.