Class: WKcSignaler

WKcSignaler

new WKcSignaler() → {Object}

The class WKcSignaler can be used to signal events (observer pattern). The class methods are usually inherited by or mixed into other classes.
Source:
Returns:
A new WKcSignaler object.
Type
Object

Methods

addObserver(p_type, p_observer) → {WKcSignaler}

Adds an observer for events of type p_type.
Parameters:
Name Type Description
p_type String | int The type of the event signaled. Usually a property value of the object $wk$.$E$. The pseudo type "*" denotes that all events are signaled to the observer.
p_observer function A callback function. The parameter list of that function depends on the signaler that dispatches events of type p_type
Source:
Returns:
this
Type
WKcSignaler

addObservers(p_observers) → {WKcSignaler}

Simultaniously adds observers for several events.
Parameters:
Name Type Description
p_observers Object A hash map. Each key denotes an event type. The values must contain the observer functions to be called.
Source:
Returns:
this
Type
WKcSignaler

removeObserver(p_type, p_observer) → {WKcSignaler}

Removes an observer for events of type p_type.
Parameters:
Name Type Description
p_type String | int The type of the event signaled. Usually a property value of the object $wk$.$E$. The pseudo type "*" denotes that all events are signaled to the observer.
p_observer Object A callback function. The parameter list of that function depends on the signaler that dispatches events of type p_type
Source:
Returns:
this
Type
WKcSignaler

removeObservers(p_observers) → {WKcSignaler}

Simultaniously removes observers for several events.
Parameters:
Name Type Description
p_observers Object A hash map. Each key denotes an event type. The values must contain the observer functions to be called.
Source:
Returns:
this
Type
WKcSignaler

signal(p_event, arguments) → {WKcSignaler}

Signals to all current observers that an event has occured. Signals an event of type p_event or p_event.type to all observers that are currently listening on events of this type. As signaler object that dispatches this event acts either p_event.signaler (if that property exists) or this.
Parameters:
Name Type Description
p_event String | int | Object The event to be signaled. Usually a property value of the object $wk$.$E$, which denotes an event type. If p_event is an object, p_event.type is used as the type of the event to be signaled.
arguments Array Arbitrary further arguments that are passed to the observer functions (together with p_event).
Source:
Returns:
this
Type
WKcSignaler
W. Kowarschick © 2013 (CC BY-NC-SA 3.0: http://creativecommons.org/licenses/by-nc-sa/3.0/)
Documentation generated by JSDoc 3.3.0-dev on Sat Oct 05 2013 15:14:39 GMT+0200 (MESZ) using the DocStrap template.