MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / readStoredFlag

Function readStoredFlag

packages/client/src/app/uiState.ts:52–62  ·  view source on GitHub ↗
(
  storageKey: string,
  defaultValue = false,
)

Source from the content-addressed store, hash-verified

50};
51
52export function readStoredFlag(
53 storageKey: string,
54 defaultValue = false,
55): boolean {
56 if (typeof window === "undefined") {
57 return defaultValue;
58 }
59
60 const value = window.localStorage.getItem(storageKey);
61 return value == null ? defaultValue : value === "1";
62}
63
64export function writeStoredFlag(storageKey: string, value: boolean): void {
65 if (typeof window === "undefined") {

Callers 2

uiState.test.tsFile · 0.90
AppShellFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected