map.apps Bundle APIs 4.20.0
    Preparing search index...

    Class AsyncWritableInMemoryStore<ItemType, IDType>

    A writeable asynchronous store.

    Type Parameters

    • ItemType extends Record<string, any>
    • IDType extends string | number

    Hierarchy (View Summary)

    Implements

    Index

    Properties

    on:
        | undefined
        | {
            <Name extends "changed">(
                eventName: Name,
                callback: EventCallback<StoreEvents<IDType>[Name]>,
            ): EventHandle;
            (
                eventName: "*",
                callback: EventCallback<StoreChangedEvent<IDType>>,
            ): EventHandle;
            (
                eventName: string | string[],
                callback: EventCallback<unknown>,
            ): EventHandle;
        }

    Register event listener for specific events.

    Type declaration

    name of the event

    the event handler callback will be invoked when the event has been emitted

    a handle to unregister from the event

    Accessors

    • get id(): undefined | string

      ID of the store.

      Returns undefined | string

    • get idProperty(): undefined | string

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

      Returns undefined | string

    Methods

    • 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

      Returns Promise<void | ItemType>

    • Delete an item by id.

      Parameters

      • id: IDType

        id of item to delete

      Returns Promise<void>