Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AsyncStore<ItemType, IDType>

An asynchronous store. This is the preferred kind of store implementation.

Type parameters

Hierarchy

Implemented by

Index

Methods

get

  • get(id: IDType, options?: GetOptions): Promise<undefined | 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>

Optional getIdentity

  • getIdentity(item: Partial<ItemType>): undefined | IDType
  • Returns an itemsā€˜s identity. This must always execute synchronously.

    Parameters

    • item: Partial<ItemType>

      the item.

    Returns undefined | IDType

    the ID

getMetadata

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

    Returns Promise<Metadata>

query

Properties

Readonly id

id: undefined | string

ID of the store.

Optional Readonly idProperty

idProperty: string

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

Generated using TypeDoc