Every term and concept in @dunky-dev/state-machine, with a one-line meaning and a link to its full doc page.
| Term | Meaning |
|---|
| machine | The built service from machine(config) — exposes start/stop/send/state/context/select. → |
| setup | The authoring entry point — setup().createMachine(literal) (lightweight) or setup<Ctx,Ev>().config(registries).createMachine(config) (names compile-checked). → |
| state | One of the flat, named situations the machine can be in (exactly one at a time). → |
| transition | An on entry: where an event takes the machine — optional target, guard, actions. → |
| event | The { type, … } object you send() to drive a transition. → |
| context | The machine’s data: one plain object, read directly (m.context.x), written via setContext. → |
| setContext | The single, batched entry point for writing context (shallow-equal deduped). → |
| send | Dispatch an event to the machine; events run to completion. → |
| Term | Meaning |
|---|
| guard | A predicate that gates a transition — return false and it doesn’t fire. → |
| and / or / not | Guard combinators for composing named guards. → |
| fallthrough | An array of transitions for one event; the first whose guard passes wins. → |
| action | A fire-and-forget side-effect run on a transition, in order — gets {context, setContext, event, send, computed}. → |
| act | Write-sugar returning a context-writing action — act({ field: value }) instead of the setContext wrapper. → |
| oneOf | Conditional action: variadic { guard?, actions } branches, first passing wins (the action analog of fallthrough). → |
| entry / exit | Actions run when a state is entered / left (any path in or out). → |
| run-to-completion | Events queue: a send() inside an action waits until the current transition finishes — no re-entrancy. → |
| Term | Meaning |
|---|
| after | A timed transition — fires after a delay while in a state; auto-cancelled on exit. → |
| delay | An after key: a number of ms, or a named delay from implementations.delays (can read context). → |
| watch | Run actions whenever a context/computed field changes — in any state, for the machine’s lifetime. → |
| computed | A lazy, memoized value derived from context (or other computeds); recomputes only when a read input changes. → |
| Term | Meaning |
|---|
| effect | A side-effect with cleanup, scoped to a state: runs on enter, its returned cleanup runs on exit. → |
| ComponentEffect | A platform-specific effect declared outside the machine — touches the DOM or reads props, calls send() into the machine. → |
| implementations | The named registry on a config — guards / actions / effects / delays referenced by string. → |
| Term | Meaning |
|---|
| connect | A pure function mapping a machine snapshot → the view-facing api (handlers + attributes). → |
| connector | Keeps connect live: memoizes the snapshot, makes props a reactive input, wires reactions. → |
| snapshot | The memoized view api the connector serves — stable identity until the machine or props change. → |
| setProps | Push new props into the connector (a reactive input; shallow-dedup’d). → |
| reaction | A [selector, callback] tuple that fires a prop-callback from outside the machine on a value change. → |
| makeReaction | Inference helper for a reaction tuple — recovers the selector→callback Value type link. → |
| bindings | The agnostic event/attr vocabulary connect speaks — onPress, role, describedBy. → |
| normalize | The per-target step translating bindings → real props (onPress → onClick; aria-* on web). → |
| the machine never sees props | The defining rule: a machine is pure behavior; props live only at the edge. → |
| the edge | Where props/platform meet the machine — the connector (reactions) + the target’s ComponentEffect (platform listeners). → |
| Term | Meaning |
|---|
| subscribe | Coarse observation — fires on any state/context change (what a useSyncExternalStore bridge uses). → |
| select | Fine-grained observation — narrows to a slice, fires only when that value changes. → |
| selection | What select(...) returns: a value-deduped view with .value + .subscribe. → |
| Term | Meaning |
|---|
| compose | Run several peer machines as one unit (orthogonal regions) — the answer to “nested/parallel” without nesting. → |
| composition | What compose(...) returns: bundled start/stop plus sync + combine. → |
| sync | A coarse cross-region rule on a composition — runs when any member changes. → |
| combine | A value-deduped selection derived across composition members. → |
| tags | Labels on states so consumers query a category (hasTag('visible')) instead of a name. → |
| hasTag | Check whether the current state carries a tag. → |
| matches | Exact-state check — m.matches('open'). → |
| createStore | A tiny reactive cell (value + listeners) for singleton state outside any one machine. → |
| store | What createStore(...) returns: get / set / subscribe (+ optional domain methods). → |
| Term | Meaning |
|---|
| start / stop | Boot / tear down the machine — effects, watchers, and reactions begin / clean up. → |
| onStart / onStop | Hang start/stop-scoped work off the machine’s lifecycle (how the connector wires reactions). → |
| MACHINE_INIT | The synthetic event fired when effects/watchers boot on start(). → |
| context ownership | One plain object per machine, copied from the config at construction, mutated in place — its identity never changes. → |