Private Optional _activeProtected _childProtected _chipProtected _eventProtected Optional _inputPrivate Optional _lastProtected _lastProtected _listenersProtected Optional _outputProtected Optional _preparationProtected Optional _reloadPrivate Readonly _signalsPrivate Readonly _startingProtected _statePrivate Readonly _statesPrivate _visitedReadonly optionsTemplate getter for the chip context provided to children. Overload to add extra attributes to the context.
Protected _activateActivate a child chip
A chip or function to create a chip
Optional options: Partial<ActivateChildChipOptions>The activated chip
Private _changeProtected _makeBy default, a chip be automatically reloaded
Protected _onProtected _onProtected _onProtected _onProtected _onProtected _removeProtected _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: EventNames[EventName]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: EventNames[EventName]Optional subscriptionHandler: SubscriptionHandlerProtected _terminateTerminate all the children, with the provided signal
Optional outputSignal: Signal<string>Protected _terminateProtected _tickProtected _unsubscribeUnsubscribe to a set of events.
By default, unsubscribes to everything. If emitter, event, or cb is provided,
unsubscribe only to those.
Optional emitter: NodeEventSourceOptional 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 inputSignal: Signal<string>Optional reloadMemento: ReloadMementoSwitch directly to a new state, terminating the current one
Terminate the chip. Should only be called from an active or paused state
By default, updates all child chips and remove those that have a signal Overload this method in subclasses to change the behavior
Generated using TypeDoc
Represents a state machine, where each state has a name, and is represented by an chip. Only one state is active at a time. The state machine has one starting state, but can have multiple ending states. When the machine reaches an ending state, it terminates with a name equal to the name of the ending state. By default, the state machine begins at the state called "start", and stops at "end".
When the active state chip terminates, the state machine transitions to another. To determine the next state, it first looks if there is a corresponding entry in the
signalstable, which can be either a state name or a function that takes(ChipContext, Signal)and returns a signal. If there is nothing in the signal table for the state, it next looks if the terminating signal is the name of another state, in which case it switches directly to that state,If you want to create embedded signal tables, try the
makeSignalTable()function.Events: