Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DataCollectionStore<T>

Retrieves entity instances from some source (such as the Generic REST API) based on given criteria such as filters, sort order, limit and offset. When entities are retrieved from REST API the entity graph is limited using a given view. Stores retrieved entity instances.

Type parameters

  • T

    entity type.

Hierarchy

Implemented by

Index

Properties

changedItems

changedItems: IObservableArray

clear

clear: function

Clears items.

Type declaration

    • (): void
    • Returns void

Optional count

count: undefined | number

Total number of entities available in the source. MobX observable.

delete

delete: function

Deletes an entity instance from the source.

param

entity instance to be deleted.

returns

promise that resolves when deletion is complete.

Type declaration

    • (e: T & WithId): Promise<any>
    • Parameters

      Returns Promise<any>

entityName

entityName: string

Optional filter

filter: EntityFilter

An object describing the filtering criteria. MobX observable.

items

items: Array<SerializedEntity<T>>

Retrieved entity instances. MobX observable.

Optional limit

limit: undefined | number

Maximum number of entities to retrieve. MobX observable.

load

load: function

Retrieves the entity instances. Once retrieval is complete, the instances will be available as items. When the source of entity instances is REST API, this method will by default request a total count of entity instances to be sent along with the retrieved instances. This number will be stored as count. Use skipCount to disable this behavior.

returns

promise that resolves when retrieval is complete.

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

Optional offset

offset: undefined | number

Position of the first entity to retrieve. Useful if you want to skip first N entities (for example, in a pagination scenario). MobX observable.

properties

properties: string[]

Not implemented

readOnlyItems

readOnlyItems: Array<SerializedEntity<T>>

A deep copy of items.

Optional skipCount

skipCount: undefined | false | true

When the source of entity instances is REST API, the load method will by default request a total count of entity instances to be sent along with the retrieved instances. This number will be stored as count. When skipCount is true, the total count will not be queried for.

Optional sort

sort: undefined | string

Sort order. Property name opionally preceeded by + or - character. If the name is preceeded by +, or there is no preceeding character, then the sort order is ascending. If the name is preceeded by -, then the sort order is descending. MobX observable.

status

Optional stringIdName

stringIdName: undefined | string

Name of the ID attribute of a String ID entity. Indicates that the entity is a String ID entity. Mandatory for String ID entities, shall be omitted otherwise.

view

view: string

Name of a view used to limit the entity graph. MobX observable.

Generated using TypeDoc