Observable interface
Methods
(static) addListener(evtName, fct)
Add a listner to this object
Parameters:
Name | Type | Description |
---|---|---|
evtName |
string | The event name |
fct |
function | A callback function to execute when event is trigged |
(static) initObservable()
Call this method in init() method of your class where you implement this mixin
(static) removeListener(evtName, fct)
Remove a listner to this object
Parameters:
Name | Type | Description |
---|---|---|
evtName |
string | The event name |
fct |
function | A callback function previously saved whith addListener() |
(static) trigger(evtName) → {boolean}
Trigger the event
Parameters:
Name | Type | Description |
---|---|---|
evtName |
string | The event name previously registered with addListener() |
Returns:
Return the result of callback function
- Type
- boolean