A utility class for managing session storage values.

  • Type Parameters

    • T = Record<string, any>

      The type of the value stored in session storage.

    Parameters

    • STORAGE_KEY: string

      The key used to store the value in session storage.

    Returns { clear: () => void; getValue: () => null | T; setValue: (value: T) => void }

    • An instance of the class with methods for getting, setting, and clearing the value.
    • clear: () => void
    • getValue: () => null | T

      Retrieves the value from the sessionStorage.

    • setValue: (value: T) => void

      Sets the value in the session storage.