Property | Defined By | ||
---|---|---|---|
numListeners : uint [read-only] The current number of listeners for the signal. | IOnceSignal | ||
valueClasses : Array
An optional array of classes defining the types of parameters sent to listeners. | IOnceSignal |
Method | Defined By | ||
---|---|---|---|
Subscribes a one-time listener for this signal. | IOnceSignal | ||
dispatch(... valueObjects):void
Dispatches an object to listeners. | IOnceSignal | ||
Unsubscribes a listener from the signal. | IOnceSignal | ||
removeAll():void
Unsubscribes all listeners from the signal. | IOnceSignal |
numListeners | property |
numListeners:uint
[read-only] The current number of listeners for the signal.
public function get numListeners():uint
valueClasses | property |
valueClasses:Array
An optional array of classes defining the types of parameters sent to listeners.
public function get valueClasses():Array
public function set valueClasses(value:Array):void
addOnce | () | method |
public function addOnce(listener:Function):ISlot
Subscribes a one-time listener for this signal. The signal will remove the listener automatically the first time it is called, after the dispatch to all listeners is complete.
Parameters
listener:Function — A function with arguments
that matches the value classes dispatched by the signal.
If value classes are not specified (e.g. via Signal constructor), dispatch() can be called without arguments.
|
ISlot — a ISlot, which contains the Function passed as the parameter
|
dispatch | () | method |
public function dispatch(... valueObjects):void
Dispatches an object to listeners.
Parameters
... valueObjects — Any number of parameters to send to listeners. Will be type-checked against valueClasses.
|
ArgumentError — are not compatible with valueClasses.
|
remove | () | method |
public function remove(listener:Function):ISlot
Unsubscribes a listener from the signal.
Parameters
listener:Function |
ISlot — a ISlot, which contains the Function passed as the parameter
|
removeAll | () | method |
public function removeAll():void
Unsubscribes all listeners from the signal.