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

Index

Properties

changedItems

changedItems: IObservableArray<any>

clear

clear: () => void

Clears items.

Type declaration

    • (): void
    • Returns void

count

count: null | number

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

delete

delete: (e: T & WithId) => Promise<any>

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

filter

filter: null | EntityFilter

An object describing the filtering criteria. MobX observable.

items

items: SerializedEntity<T>[]

Retrieved entity instances. MobX observable.

limit

limit: null | number

Maximum number of entities to retrieve. MobX observable.

load

load: () => Promise<void>

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>

offset

offset: null | 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.

Readonly properties

properties: string[]

Not implemented

Readonly readOnlyItems

readOnlyItems: SerializedEntity<T>[]

A deep copy of items.

skipCount

skipCount: null | boolean

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.

sort

sort: null | 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

stringIdName

stringIdName: null | 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: null | string

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

Generated using TypeDoc