A weak implementation for the Store interface.

This means the data saved in this store does not persist throughout application runs. However, data can be shared across two instances of the store.

Implements

Constructors

Properties

Methods

Constructors

Properties

rootKey: string

Methods

  • Deletes a specific entry from the store.

    Parameters

    • index: StorageIndex

      The index of the entry we want to delete. If given an empty array as index, will delete all entries on the store.

    Returns void

  • 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.

  • 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