Capture from a local session
session argument can be an actual LocalGameSession or any object that exposes getReplayData(). React’s useMatch().state.replayData exposes it in local mode; pass { getReplayData: () => replayData } if you want to capture from a component.
Envelope shape
Load and materialize
materializeSavedReplay replays the action log against a fresh reducer and returns a ReplayTimeline<TGame>:
Scrub with a cursor
ReplayCursorState so you can feed it into React state yourself.
Branching
For “what if” analysis, fork the timeline at an action and replay new actions from there:Load in inspector
For an interactive inspector, wrap the timeline with theReplayInspector from @openturn/inspector-ui’s createInspector(bindings). See how-to: debug with inspector.
Related
- Tutorial: tic-tac-toe replay walks through capture and load end to end.
- Reference: replay is the full API reference.