Metakit / @doeixd/metakit/machine

phases

function · packages/metakit/src/machinePhases.ts:128

function phases<S extends Schema.Top, P extends PhaseField>(
  state: S,
  select: (
    state: PathAccessor<S['Type'], S['Type']>,
  ) => Path.Path<S['Type'], P>,
): Phases<S, P>

The phases of the field select picks from state (state => state.phase): one reference per literal, or per variant of a union of tagged structs, as phase, and from, which builds the transitions between them. A field that is neither throws.