@mocanvas/editor · function

loadSessionStateSnapshotIntoStore

declare function loadSessionStateSnapshotIntoStore(store: EditorStore, snapshot: TLSessionStateSnapshot, opts?: TLLoadSessionStateSnapshotOptions): void

Apply a session snapshot to a store.

Defensive throughout, because the two halves can disagree: the snapshot was taken against a document that has since been edited by somebody else, or loaded next to a different document entirely. A page that is gone is skipped, a selection of deleted shapes is dropped, and a snapshot from a schema version this build does not know is ignored rather than half-applied — half-applied session state is how a person ends up on a blank page with a camera pointing at nothing.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.