travels3.0
Resources

Examples

Runnable and copyable Travels examples for core history, frameworks, persistence, and editing applications.

The repository contains small examples that exercise the public API without hiding the integration boundary behind a demo framework. Use them alongside the focused guides in this documentation.

Core examples

ExampleWhat it demonstrates
Basic usageCreate a timeline, update state, navigate, and subscribe.
Manual archiveGroup pending updates into application-defined undo steps.
PersistenceSerialize, deserialize, and restore a versioned timeline.
Local-first persistenceA durable editing flow built around stored snapshots.
Persistence adaptersStorage-oriented adapter patterns and recovery.

Framework integrations

ExampleFramework or pattern
React integrationuseSyncExternalStore, revisions, state, and controls.
Vue integrationVue state binding and undo/redo.
Zustand integrationImmutable timeline synchronization with a store.
MobX integrationReference-stable mutable history.
Pinia integrationA setup store with mutable Travels state.

Editing applications

You can also try the Travels Counter Demo on CodeSandbox.

Run repository checks

From the repository root:

corepack enable
pnpm install
pnpm run test:examples
pnpm run test:types
pnpm run test

The examples are included in the TypeScript example checks. When adapting one, keep the core invariants: one authoritative update path, synchronous timeline callbacks, read-only shared views, and semantic validation for unverified persisted history.

On this page