Interface AsyncWritableStore<ItemType, IDType>

An asynchronous store that accepts changes to it's contents.

Type Parameters

Hierarchy

Implemented by

Properties

id: undefined | string

ID of the store.

idProperty?: string

Name of the property used as ID. If not provided, the 'getIdentity' method must be declared.

Methods

  • Create a new item. Throws an error, if the item already exists. The 'overwrite' option is assumed to be false).

    Parameters

    Returns Promise<void | ItemType>

  • Retrieves an item by its identifier.

    Parameters

    • id: IDType

      id of an item in the store.

    • Optional options: GetOptions

      options to specify the result.

    Returns Promise<undefined | ItemType>

  • Returns an itemsā€˜s identity. This must always execute synchronously.

    Parameters

    • item: Partial<ItemType>

      the item.

    Returns undefined | IDType

    the ID

  • Returns any available metadata about the store. This may include attribution, available fields, cache directives, history or version information.

    Returns Promise<Metadata>

  • Saves the given item. Depending on the specified options, a new item is created or a given item is updated.

    Parameters

    • item: Partial<ItemType>

      item to update/create

    • Optional options: CreateOptions<IDType>

      options to specify the PUT operation

    Returns Promise<void | ItemType>

  • Delete an item by id.

    Parameters

    • id: IDType

      id of item to delete

    Returns Promise<void>

Generated using TypeDoc