Metakit / @doeixd/metakit/machine

Phase

interface · packages/metakit/src/machinePhaseTypes.ts:24

interface Phase<State, Name extends string, Value = Name> {
  readonly _tag: 'Phase'
  readonly name: Name
  readonly _state?: (state: State) => State
  readonly _value?: () => Value
}

One phase of a machine: a literal of its phase field, or a variant of the tagged union there, named by the value Machine.phases returned (phase.Editing), never by its text. Value is what the field holds in the phase: the literal, or the variant with its fields.

Members

Phase._tag

property · packages/metakit/src/machinePhaseTypes.ts:25

readonly _tag: 'Phase'

Phase.name

property · packages/metakit/src/machinePhaseTypes.ts:26

readonly name: Name

Phase._state

property · packages/metakit/src/machinePhaseTypes.ts:28

readonly _state?: (state: State) => State

Ties the reference to the state of the machine whose phase it is.

Phase._value

property · packages/metakit/src/machinePhaseTypes.ts:30

readonly _value?: () => Value

What the phase field holds in this phase.