Interface SyncWritableStore<ItemType, IDType>

A synchronous store that accepts changes to it's contents.

Deprecated

use WritableAsyncStore instead

Type Parameters

Hierarchy

Implemented by

Properties

id: 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 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 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 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 ItemType

  • Delete an item by id.

    Parameters

    • id: IDType

      id of item to delete

    Returns void

Generated using TypeDoc