Protected
_chipPrivate
_elapsedProtected
_eventProtected
_inputPrivate
_lastProtected
_lastProtected
_outputProtected
Optional
_reloadProtected
_stateReadonly
emitterStatic
prefixedProtected
_makeBy default, an chip be automatically reloaded
Protected
_onProtected
_onProtected
_onProtected
_subscribeStart listening to events of a certain type emitted by an object.
The callback will be called with the chip as this
.
Works by default for both NodeJS- and DOM-style events.
If you are interfacing with a different event system, you can provide a
subscriptionHandler
that knows how to handle it.
Rest
...args: any[]Optional
subscriptionHandler: SubscriptionHandlerProtected
_subscribeListen to a single event emitted by an object, then stop.
The callback will be called with the chip as this
.
Works by default for both NodeJS- and DOM-style events.
If you are interfacing with a different event system, you can provide a
subscriptionHandler
that knows how to handle them.
Rest
...args: any[]Optional
subscriptionHandler: SubscriptionHandlerProtected
_unsubscribeUnsubscribe to a set of events.
By default, unsubscribes to everything. If emitter
, event
, or cb
is provided,
unsubscribe only to those.
Optional
emitter: objectOptional
event: stringOptional
cb: ((...args) => void)Rest
...args: unknown[]Activate the chip, with a provided context and input signal. Should only be called from an inactive state
Optional
reloadMemento: ReloadMementoPause the chip, informing it that it won't receive ticks for a while
Resumes the chip after it was paused
Terminate the chip. Should only be called from an active or paused state
Update the chip, provided a new time
Generated using TypeDoc
A base class for creating chips that reduces boilerplate code. To use it, simply override some or all of the following protected methods:
_chipContext
_lastTickInfo
properties to obtain the latest information there.In addition, you can subscribe to events using
_subscribe()
in a way that automatically unsubscribes when the chip is terminated.