MCPcopy Create free account
hub / github.com/dailydotdev/apps / getStorageOverride

Function getStorageOverride

packages/shared/src/graphql/batch.ts:32–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30};
31
32const getStorageOverride = (): boolean | undefined => {
33 if (process.env.NODE_ENV === 'production') {
34 return undefined;
35 }
36
37 try {
38 const value = globalThis.localStorage?.getItem(BATCHING_STORAGE_KEY);
39
40 if (value === '1') {
41 return true;
42 }
43
44 if (value === '0') {
45 return false;
46 }
47 } catch {
48 // storage can throw in private mode
49 }
50
51 return undefined;
52};
53
54const isBatchingEnabled = (): boolean =>
55 getStorageOverride() ?? batchingEnabled;

Callers 1

isBatchingEnabledFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected