MCPcopy Create free account
hub / github.com/block/buzz / getSnapshot

Function getSnapshot

desktop/src/shared/features/useFeatureEnabled.ts:46–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44const emptyOverrides = Object.freeze({}) as Record<string, boolean>;
45
46function getSnapshot(): string {
47 const raw = JSON.stringify(getOverrides());
48 if (raw !== cachedRaw) {
49 cachedRaw = raw;
50 cachedParsed = JSON.parse(raw) as Record<string, boolean>;
51 }
52 return raw;
53}
54
55/**
56 * Server-side snapshot for useSyncExternalStore.

Callers 1

getParsedSnapshotFunction · 0.70

Calls 2

getOverridesFunction · 0.90
parseMethod · 0.45

Tested by

no test coverage detected