The Store class defines a local data store, and provides methods to retrieve data from the API.

Hierarchy

  • Store

Constructors

Properties

data: StoreData = {}

The local data store. A tree of resource types to IDs, such that accessing data[type][id] will return the model for that type/ID.

models: Record<string, (new () => Model)>

The model registry. A map of resource types to the model class that should be used to represent resources of that type.

Type declaration

Methods

  • Get a record from the store by the value of a model attribute.

    Type Parameters

    • M extends Model<M>

    • T = unknown

    Parameters

    • type: string

      The resource type.

    • key: keyof M

      The name of the method on the model.

    • value: T

      The value of the model attribute.

    Returns undefined | M

Generated using TypeDoc v0.24.8