MCPcopy
hub / github.com/facebook/react / saveStore

Function saveStore

compiler/apps/playground/lib/stores/store.ts:33–37  ·  view source on GitHub ↗
(store: Store)

Source from the content-addressed store, hash-verified

31 * Serialize, encode, and save @param store to localStorage and update URL.
32 */
33export function saveStore(store: Store): void {
34 const hash = encodeStore(store);
35 localStorage.setItem('playgroundStore', hash);
36 history.replaceState({}, '', `#${hash}`);
37}
38
39/**
40 * Check if @param raw is a valid Store by if

Callers 1

StoreProviderFunction · 0.90

Calls 1

encodeStoreFunction · 0.85

Tested by

no test coverage detected