Metakit / @doeixd/metakit/machine

lift

function · packages/metakit/src/machine.ts:201

function lift<
  Outer,
  Child,
  Transitions extends Readonly<Record<string, unknown>>,
>(
  path: Path.Path<Outer, Child | null | undefined>,
  machine: Machine<Child, Transitions>,
): Lifted<Outer, Transitions>

Lift every transition of a child machine along path, as Transition.lift does one: each reads and writes under path, and is refused where the state holds no child there, so path may lead to a nullable or optional field. Give the result to Machine.compose.