mazey
    Preparing search index...

    Variable getLocalStorageConst

    getLocalStorage: <T>(key: string) => T | null = getLocalJSON

    Deprecated alias of getLocalJSON.

    Type Declaration

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

        Usage:

        import { setLocalJSON, getLocalJSON } from "mazey";

        setLocalJSON("preferences", { theme: "dark" });
        const preferences = getLocalJSON("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 getLocalJSON instead.