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

    Class SyncInMemoryStore<ItemType, IDType>

    A read only synchronous store.

    Type Parameters

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

    Hierarchy (View Summary)

    Implements

    Index

    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

    • Emits an event. All associated event listeners registered for the given event name will be invoked asynchronously.

      Type Parameters

      • Name extends "changed"

      Parameters

      • eventName: Name

        The name of the event.

      • ...value: Params<StoreEvents<IDType>[Name]>

        The event value. Passed to all event listeners. Note: no value can be passed if the event type is void.

      Returns void

    • Retrieves an item by its identifier.

      Parameters

      • id: IDType

        id of an item in the store.

      Returns undefined | ItemType

    • Returns an items‘s identity. This must always execute synchronously.

      Parameters

      Returns IDType

      the ID

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

      Returns Metadata

    • Register event listener for specific events.

      Type Parameters

      • Name extends "changed"

      Parameters

      Returns EventHandle

      a handle to unregister from the event

    • Register event listener for any event.

      Parameters

      Returns EventHandle

      a handle to unregister from the events

    • Register event listener for the events listed in eventName. Comma separated event names are possible, for example "eventA,eventB".

      Parameters

      • eventName: string | string[]

        the event name or list of names

      • callback: EventCallback<unknown>

        the event handler callback

      Returns EventHandle

      a handle to unregister from the event(s)