mazey
    Preparing search index...

    Variable getSessionStorageConst

    getSessionStorage: <T>(key: string) => T | null = getSessionJSON

    Deprecated alias of getSessionJSON.

    Type Declaration

      • <T>(key: string): T | null
      • Read a value from sessionStorage, parsing JSON when possible.

        Usage:

        import { setSessionJSON, getSessionJSON } from "mazey";

        setSessionJSON("preferences", { theme: "dark" });
        const preferences = getSessionJSON("preferences");
        console.log(JSON.stringify(preferences));

        Output:

        {"theme":"dark"}
        

        Type Parameters

        • T

        Parameters

        • key: string

          Storage key.

        Returns T | null

        The parsed value, raw stored value, or null when no value exists.

    Use getSessionJSON instead.