Signal
Signals are a simple pub-sub mechanism.
DOMNodes can subscribe to a signal, which will invoke a callback when the signal is published.
This is experimental for now, for internal use. It may be part of the public API in a future release.
Signal
class
¶
A signal that a widget may subscribe to, in order to invoke callbacks when an associated event occurs.
Parameters
Parameter | Default | Description |
---|---|---|
owner
DOMNode
|
required | The owner of this signal. |
name
str
|
required | An identifier for debugging purposes. |
subscribe
method
¶
Subscribe a node to this signal.
When the signal is published, the callback will be invoked.
Parameters
Parameter | Default | Description |
---|---|---|
node
DOMNode
|
required | Node to subscribe. |
callback
IgnoreReturnCallbackType
|
required | A callback function which takes no arguments, and returns anything (return type ignored). |
Raises
Type | Description |
---|---|
SignalError
|
Raised when subscribing a non-mounted widget. |