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