Connect a slot to the signal.
The slot to invoke when the signal is emitted.
The this
context for the slot. If provided,
this must be a non-primitive object.
true
if the connection succeeds, false
otherwise.
Slots are invoked in the order in which they are connected.
Signal connections are unique. If a connection already exists for
the given slot
and thisArg
, this method returns false
.
A newly connected slot will not be invoked until the next time the signal is emitted, even if the slot is connected while the signal is dispatching.
Disconnect a slot from the signal.
The slot to disconnect from the signal.
The this
context for the slot. If provided,
this must be a non-primitive object.
true
if the connection is removed, false
otherwise.
If no connection exists for the given slot
and thisArg
, this
method returns false
.
A disconnected slot will no longer be invoked, even if the slot is disconnected while the signal is dispatching.
Generated using TypeDoc
An object used for type-safe inter-object communication.
Notes
Signals provide a type-safe implementation of the publish-subscribe pattern. An object (publisher) declares which signals it will emit, and consumers connect callbacks (subscribers) to those signals. The subscribers are invoked whenever the publisher emits the signal.