Function getFromLocalStorage

  • Retrieves a value from local storage by the given key. If the item has an associated expiration key and the expiration date has passed, the item and its expiration key are removed from local storage and null is returned.

    Parameters

    • key: string

      The key of the item to retrieve from local storage.

    Returns string | null

    • The value associated with the key, or null if the item does not exist or has expired.