Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ClientSideDataCollectionStore<T>

A variant of DataCollectionStore that works with a client-side source of entities.

Type parameters

  • T

    entity type.

Hierarchy

Index

Properties

adjustItems

adjustItems: () => void

Sets items based on allItems and other conditions. Currently it only performs client-side sorting based on sort field, client-side filtering is currently not supported.

Type declaration

    • (): void
    • Returns void

allItems

allItems: SerializedEntity<T>[]

The client-side source from where the entities are being retrieved. An array of entity instances with default sort order and no filtering applied.

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