The storage index in the ordered list of keys to navigate on the store to reach a specific entry.

Example

For the index ["user", "baseline", "boolean", "tab.click"], we would search for the following entry:

{ "user": { "baseline": { "boolean": { "tab.click": <This is the value we are looking for!> } } } }

Implements

Constructors

Properties

logTag: string
rootKey: string

Methods

  • Gets the value recorded to the given index on the store.

    Parameters

    • index: StorageIndex = []

      The index of the entry to get. If the index is empty, the whole store is returned.

    Returns undefined | JSONValue

    The value found for the given index on the storage. In case nothing has been recorded on the given index, returns undefined.

    Throws

    In case an value which is not valid JSON is found.

  • Check to see if the session information should be updated whenever interacting with storage. If we are updating the existing session metrics then running the updateSessionInfo function again would result in an infinite loop of updating the metrics and re-running this function.

    Parameters

    Returns boolean

    Whether we should update session metrics.

  • Updates a specific entry from the store.

    Note

    If intermediary steps of the given index already contains a string, it will be overwritten.

    For example, if you attempt to update something under the index ["foo", "bar"] and the storage currently contains the following data:

    {
    "foo": "some value"
    }

    It will be overwritten like so:

    ``json { "foo": { "bar": "new value!" } }


    @param index The index of the entry to update.
    @param transformFn A transformation function to apply to the currently persisted value.

    @throws In case the index is an empty array.

    Parameters

    Returns void

Generated using TypeDoc