mazey
    Preparing search index...

    Function setLocalJSON

    • Serialize a value as JSON and store it in localStorage.

      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.

      • value: T | null = null

        Value to serialize and store.

      Returns void

      This function does not return a value.