new Signal()
Members
-
hasListeners
-
Returns whether there are any functions bound to the Signal or not.
Methods
-
bind(listener [, thisRef])
-
Binds a function as a listener to the Signal
Parameters:
Name Type Argument Description listener
function A function to be called when the function is dispatched.
thisRef
Object <optional>
If provided, the object that will become "this" in the function. Used in a class as such:
Example
signal.bind(this.methodFunction, this);
-
dispatch( [payload])
-
Dispatches the signal, causing all the listening functions to be called.
Parameters:
Name Type Argument Description payload
<optional>
An optional amount of arguments to be passed in as a parameter to the listening functions. Can be used to provide data.
-
unbind()
-
Removes a function as a listener.
-
unbindAll()
-
Unbinds all bound functions.