An event source whose firing can be temporarily disabled
Calls to disable() and enable() may be nested, so the number of
enable() calls must match the number of disable() calls in order for
the event source to resume firing.
Events occuring while the source is disabled may be buffered. Readable
sources will normally buffer only their last value, and therefore send
at most one event when re-enabled. Non-readable sources such as
Broadcast and Distributor typically will buffer as many events as there
are currently registered callbacks for, and raise an error if more events
occur, in order to avoid growing the buffer indefinitely.
Methods
|
|
disable
enable
|
|
disable
|
disable ()
Stop events from firing
|
|
enable
|
enable ()
Reenable events, and fire any that accumulated in the meanwhile
|
|