Class SignalBinding
Defined in: signals.js.
Class Detail
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:
- {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
Method Detail
Detach binding from signal. - alias to: mySignal.remove(myBinding.getListener());
- Returns:
- {Function|null} Handler function bound to the signal or `null` if binding was previously detached.
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.