mazey
    Preparing search index...

    Variable setSessionStorageConst

    setSessionStorage: <T>(key: string, value?: T | null) => void = setSessionJSON

    Deprecated alias of setSessionJSON.

    Type Declaration

      • <T>(key: string, value?: T | null): void
      • Serialize a value as JSON and store it in sessionStorage.

        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.

        • value: T | null = null

          Value to serialize and store.

        Returns void

        This function does not return a value.

    Use setSessionJSON instead.