• Sequence a list of messages against a single graph instance.

    Type Parameters

    • Msg

      The application's message union.

    • G extends Graph = Graph

      The graph subtype.

    Parameters

    • update: Update<Msg, G>

      The runner that handles a single message.

    • graph: G

      The graph handle to drive.

    • messages: readonly Msg[]

      Messages applied in order.

    Returns G

    The same graph handle, after every message has been applied.

    Useful for tests and replays; in normal application code dispatch happens via useDispatch() (see useDispatch.ts). Each message still produces exactly one commit — commit is the only way time advances, and it advances by exactly one GraphTime per call — so runMessages deliberately does not batch them. The sequence [msg1, msg2, msg3] produces three discrete commits, each with its own intent label, each fully observable in the commit log. The graph handle is returned for caller convenience (chain into a graph.read(...)); the handle's identity is unchanged.

    const final = runMessages(update, graph, [msg1, msg2, msg3])