A serializable, append-only action log for replay, undo checkpoints, synchronization and
debugging. It does not interpret actions or events: the game decides how to reapply an
action, while the journal preserves the exact order and resulting event batch.
constjournal = newActionJournal<string, { type: string }>(); journal.append('open-door', [{ type:'door-opened' }]); constcheckpoint = journal.mark(); // An undo system can restore its state and replay journal.since(checkpoint).
A serializable, append-only action log for replay, undo checkpoints, synchronization and debugging. It does not interpret actions or events: the game decides how to reapply an action, while the journal preserves the exact order and resulting event batch.
Example