Index

Classes

Class

Fields

Methods

Class signals.SignalBinding


Defined in: js-signals.js.

Class Detail
signals.SignalBinding(signal, listener, isOnce, listenerContext, priority)

Object that represents a binding between a Signal and a listener function.
- This is an internal constructor and shouldn't be called by regular users.
- inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.


Author: Miller Medeiros.
Parameters:
{signals.Signal} signal
Reference to Signal object that listener is currently bound to.
{Function} listener
Handler function bound to the signal.
{boolean} isOnce
If binding should be executed just once.
{Object} listenerContext Optional
Context on which listener will be executed (object that should represent the `this` variable inside listener function).
{Number} priority Optional
The priority level of the event listener. (default = 0).
Field Detail
{boolean} active

If binding is active and should be executed.

{Object|undefined|null} context

Context on which listener will be executed (object that should represent the this variable inside listener function).

Method Detail
{Function} detach()

Detach binding from signal. - alias to: mySignal.remove(myBinding.getListener());

Returns:
{Function} Handler function bound to the signal.
dispose()

Remove binding from signal and destroy any reference to external Objects (destroy SignalBinding object).

IMPORTANT: calling methods on the binding instance after calling dispose will throw errors.

{*} execute(paramsArr)

Call listener passing arbitrary parameters.

If binding was added using `Signal.addOnce()` it will be automatically removed from signal dispatch queue, this method is used internally for the signal dispatch.

Parameters:
{Array} paramsArr Optional
Array of parameters that should be passed to the listener
Returns:
{*} Value returned by the listener.
{Function} getListener()
Returns:
{Function} Handler function bound to the signal.
{boolean} isOnce()
Returns:
{boolean} If SignalBinding will only be executed once.
{string} toString()
Returns:
{string} String representation of the object.

Documentation generated by JsDoc Toolkit 2.4.0 on Tue May 03 2011 01:07:20 GMT-0300 (BRT) | template based on Steffen Siering jsdoc-simple.