Class adobeDPS-Signal
- Author:
- Miller Medeiros
- Platforms:
- iOS, Android, Windows
Constructor
[inner]
Custom event broadcaster
- inspired by Robert Penner's AS3 Signals.
- inspired by Robert Penner's AS3 Signals.
Fields
Field | Defined By | |
---|---|---|
memorize
: Boolean
If Signal should keep record of previously dispatched parameters and
automatically execute listener during
add() /addOnce() if Signal was
already dispatched before.
|
Signal
|
|
active
: Boolean
If Signal is active and should broadcast events.
|
Signal
|
Methods
Method | Defined By | |
---|---|---|
has(listener:Function, context:Object)
Check if listener was attached to Signal.
|
Signal
|
|
add(listener:Function, listenerContext:Object, priority:Number)
Add a listener to the signal.
|
Signal
|
|
addOnce(listener:Function, listenerContext:Object, priority:Number)
Add listener to the signal that should be removed after first execution (will be executed only once).
|
Signal
|
|
remove(listener:Function, context:Object)
Remove a single listener from the dispatch queue.
|
Signal
|
|
Remove all listeners from the Signal.
|
Signal
|
|
|
Signal
|
|
halt()
Stop propagation of the event, blocking the dispatch to next listeners on the queue.
|
Signal
|
|
dispatch(params:...*)
Dispatch/Broadcast Signal to all listeners added to the queue.
|
Signal
|
|
forget()
Forget memorized arguments.
|
Signal
|
|
dispose()
Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).
|
Signal
|
|
toString()
|
Signal
|
Class Detail
adobeDPS-Signal()
[inner]
Custom event broadcaster
- inspired by Robert Penner's AS3 Signals.
- inspired by Robert Penner's AS3 Signals.
Field Details
memorize
: Boolean
If Signal should keep record of previously dispatched parameters and
automatically execute listener during
add()
/addOnce()
if Signal was
already dispatched before.
- Platforms:
- iOS, Android, Windows
active
: Boolean
If Signal is active and should broadcast events.
IMPORTANT: Setting this property during a dispatch will only affect the next dispatch, if you want to stop the propagation of a signal use halt()
instead.
- Platforms:
- iOS, Android, Windows
Method Details
has(listener:Function, context:Object)
: Boolean
Check if listener was attached to Signal.
Parameters | ||
---|---|---|
listener | Function | |
context | Object |
- Returns:
- Boolean if Signal has the specified listener.
- Platforms:
- iOS, Android, Windows
Add a listener to the signal.
Parameters | ||
---|---|---|
listener | Function | Signal handler function. |
listenerContext | Object |
Context on which listener will be executed (object that should represent the this variable inside listener function).
|
priority | Number | The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0) |
- Returns:
- adobeDPS-SignalBinding An Object representing the binding between the Signal and listener.
- Platforms:
- iOS, Android, Windows
Add listener to the signal that should be removed after first execution (will be executed only once).
Parameters | ||
---|---|---|
listener | Function | Signal handler function. |
listenerContext | Object |
Context on which listener will be executed (object that should represent the this variable inside listener function).
|
priority | Number | The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0) |
- Returns:
- adobeDPS-SignalBinding An Object representing the binding between the Signal and listener.
- Platforms:
- iOS, Android, Windows
remove(listener:Function, context:Object)
: Function
Remove a single listener from the dispatch queue.
Parameters | ||
---|---|---|
listener | Function | Handler function that should be removed. |
context | Object | Execution context (since you can add the same handler multiple times if executing in a different context). |
- Returns:
- Function Listener handler function.
- Platforms:
- iOS, Android, Windows
removeAll()
Remove all listeners from the Signal.
- Platforms:
- iOS, Android, Windows
getNumListeners()
: Number
- Returns:
- Number Number of listeners attached to the Signal.
- Platforms:
- iOS, Android, Windows
halt()
Stop propagation of the event, blocking the dispatch to next listeners on the queue.
IMPORTANT: should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.
- See:
- adobeDPS-Signal.prototype.disable
- Platforms:
- iOS, Android, Windows
dispatch(params:...*)
Dispatch/Broadcast Signal to all listeners added to the queue.
Parameters | ||
---|---|---|
params | ...* | Parameters that should be passed to each handler. |
- Platforms:
- iOS, Android, Windows
forget()
Forget memorized arguments.
- See:
- adobeDPS-Signal.memorize
- Platforms:
- iOS, Android, Windows
dispose()
Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).
IMPORTANT: calling any method on the signal instance after calling dispose will throw errors.
- Platforms:
- iOS, Android, Windows
toString()
: String
- Returns:
- String String representation of the object.
- Platforms:
- iOS, Android, Windows
©2012-2013 Adobe Systems, inc
Documentation generated by JsDoc Toolkit 2.4.0 on Mon Aug 31 2015 09:23:27 GMT-0700 (PDT)
Documentation generated by JsDoc Toolkit 2.4.0 on Mon Aug 31 2015 09:23:27 GMT-0700 (PDT)