Metakit / @doeixd/metakit/machine

reachability

function · packages/metakit/src/machinePhaseGraph.ts:154

function reachability<
  State,
  Transitions extends Readonly<Record<string, unknown>>,
>(
  machine: Machine<State, Transitions>,
  options?: {
    readonly from?: ReadonlyArray<NoInfer<State>>
  },
): Reachability<State, PhaseNameOf<Transitions> & string>

The phases of machine its start cannot reach, and those it can never leave. It follows edges between phases and reads no guard, so a phase it calls unreachable is (no transition but those built with from moves the phase), while one it reaches may still be guarded off. A machine with no start is refused unless from gives the states to begin in.