MCPcopy
hub / github.com/tldraw/tldraw / getStoreSnapshot

Method getStoreSnapshot

packages/store/src/lib/Store.ts:824–829  ·  view source on GitHub ↗

* Get a serialized snapshot of the store and its schema. * This includes both the data and schema information needed for proper migration. * * @example * ```ts * const snapshot = store.getStoreSnapshot() * localStorage.setItem('myApp', JSON.stringify(snapshot)) * * // Later... * co

(scope: RecordScope | 'all' = 'document')

Source from the content-addressed store, hash-verified

822 * @public
823 */
824 getStoreSnapshot(scope: RecordScope | 'all' = 'document'): StoreSnapshot<R> {
825 return {
826 store: this.serialize(scope),
827 schema: this.schema.serialize(),
828 }
829 }
830
831 /**
832 * Migrate a serialized snapshot to the current schema version.

Callers 7

Store.test.tsFile · 0.80
getSnapshotFunction · 0.80
parseAndLoadDocumentFunction · 0.80
importFromUrlFunction · 0.80
uploadTldrFileMethod · 0.80

Calls 1

serializeMethod · 0.95

Tested by

no test coverage detected