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
12345678910import { Result } from "effect";
/** * This browser's localStorage, or nothing where reading it throws (a private * window, blocked site data, the server). A preference lives here, never in a * cookie: a cookie would take the page out of the edge cache. */export const browserStorage = (): Storage | undefined => Result.getOrUndefined(Result.try(() => globalThis.localStorage));