Implementation of caching that uses session storage

Implements

Constructors

Properties

Methods

Constructors

  • Parameters

    • Optional prefix: string

    Returns SessionStorageCache

Properties

prefix: string

Methods

  • It returns an array of all the keys in the session storage that start with the prefix

    Returns string[]

    An array of all the keys in the sessionStorage that start with the prefix.

  • It gets the value of the key from the session storage, parses it as JSON, and returns it

    Type Parameters

    Parameters

    • key: string

      The key to store the data under.

    Returns undefined | T

    The value of the key in the sessionStorage.

  • It removes the item from session storage with the given key

    Parameters

    • key: string

      The key to store the value under.

    Returns void

  • It takes a key and an entry, and sets the entry in the session storage with the key

    Type Parameters

    Parameters

    • key: string

      The key to store the entry under.

    • entry: T

      The value to be stored in the cache.

    Returns void

Generated using TypeDoc