Signal#addOnce()

addOnce(listener, listenerContext, priority, args) → {Phaser.SignalBinding}

Add a one-time listener - the listener is automatically removed after the first execution.

If there is as memorized event then it will be dispatched and
the listener will be removed immediately.

Parameters
Name Type Argument Default Description
listener function

The function to call when this Signal is dispatched.

listenerContext object <optional>

The context under which the listener will be executed (i.e. the object that should represent the this variable).

priority number <optional>

The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added (default = 0)

args any <optional>
<repeatable>
(none)

Additional arguments to pass to the callback (listener) function. They will be appended after any arguments usually dispatched.

Returns

An Object representing the binding between the Signal and listener.

Source code: core/Signal.js (Line 274)
doc_phaser
2017-02-14 11:09:22
Comments
Leave a Comment

Please login to continue.