storage.ts
This file
Path
apps/web/src/features/shared/storage.ts
9 lines · 387 bytes · TypeScript
Last changed by
Merge redesign into mainoscabrielbefore adoptioncaedd21
History of this fileTake it
Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 1–9why, one step back1import { Result } from "effect";23/**4 * This browser's localStorage, or nothing where reading it throws (a private5 * window, blocked site data, the server). A preference lives here, never in a6 * cookie: a cookie would take the page out of the edge cache.7 */8export const browserStorage = (): Storage | undefined =>9 Result.getOrUndefined(Result.try(() => globalThis.localStorage));