src/app/data-dgql/query.ts
Provides a view into a list of items.
See DataQuery for more information, and DataService to obtain a DataList. Lists are identified by a ListId.
The current view is defined by following properties:
Changing any of these properties will reload the list (debounced).
Properties |
Methods |
Accessors |
id |
Type : I
|
Inherited from
DataQuery
|
Defined in
DataQuery:48
|
The ID of this data. |
interactive |
Default value : false
|
Inherited from
DataQuery
|
Defined in
DataQuery:137
|
If true, will prolong debounce time a bit. |
loading |
Default value : false
|
Inherited from
DataQuery
|
Defined in
DataQuery:49
|
currentHasNode | ||||||
currentHasNode(key: NodeId)
|
||||||
Defined in src/app/data-dgql/query.ts:578
|
||||||
Returns true if the current result contains the given node.
Parameters :
Returns :
boolean
|
firstPage |
firstPage()
|
Defined in src/app/data-dgql/query.ts:590
|
Moves the view to the first page.
Returns :
boolean
|
hydrateInitial | ||||||||
hydrateInitial(data: Promise<HydrateList<IdT>>)
|
||||||||
Defined in src/app/data-dgql/query.ts:629
|
||||||||
Type parameters :
|
||||||||
Hydrates this list with initial data in the API format If you've already got data from the API that contains the first page of this list, you can use this method to insert that data directly and avoid triggering a redundant API request.
Parameters :
Returns :
void
|
nextPage |
nextPage()
|
Defined in src/app/data-dgql/query.ts:610
|
Moves the view to the next page.
Returns :
boolean
|
prevPage |
prevPage()
|
Defined in src/app/data-dgql/query.ts:599
|
Moves the view to the previous page.
Returns :
boolean
|
setParams |
setParams()
|
Defined in src/app/data-dgql/query.ts:504
|
Updates the
Returns :
void
|
dataAsPromise |
dataAsPromise()
|
Inherited from
DataQuery
|
Defined in
DataQuery:171
|
Returns the data as a promise, without having to create a subscription. If cached data is available, this will return the data immediately; otherwise, this will load the data with an API request. Example
Returns :
Promise<T>
|
hydrateRaw | ||||||
hydrateRaw(preparedData: Promise
|
||||||
Inherited from
DataQuery
|
||||||
Defined in
DataQuery:231
|
||||||
Use when data has not yet been loaded but is available from elsewhere.
Parameters :
Returns :
void
|
invalidate |
invalidate()
|
Inherited from
DataQuery
|
Defined in
DataQuery:264
|
Deletes current data.
Returns :
void
|
load |
load()
|
Inherited from
DataQuery
|
Defined in
DataQuery:222
|
Loads data.
Returns :
void
|
loadDebounced | ||||||
loadDebounced(interactive)
|
||||||
Inherited from
DataQuery
|
||||||
Defined in
DataQuery:250
|
||||||
Loads data after a short delay. Will debounce.
Parameters :
Returns :
void
|
loadIfNeeded |
loadIfNeeded()
|
Inherited from
DataQuery
|
Defined in
DataQuery:240
|
Will load data if it's stale or not present.
Returns :
void
|
subscribeLazy | ||||||||
subscribeLazy(...args: any[])
|
||||||||
Inherited from
DataQuery
|
||||||||
Defined in
DataQuery:295
|
||||||||
Will subscribe to the data, but not cause a reload unless there is no data.
Parameters :
Returns :
Subscription
|
totalCount |
gettotalCount()
|
Defined in src/app/data-dgql/query.ts:514
|
Returns the total number of items. Null if not loaded.
Returns :
number
|
currentItems |
getcurrentItems()
|
Defined in src/app/data-dgql/query.ts:519
|
Returns the currently loaded items in an array.
Returns :
T[]
|
filter | ||||||
getfilter()
|
||||||
Defined in src/app/data-dgql/query.ts:527
|
||||||
Current list filter object.
Returns :
F | undefined
|
||||||
setfilter(f: F)
|
||||||
Defined in src/app/data-dgql/query.ts:530
|
||||||
Parameters :
Returns :
void
|
cursor | ||||||
getcursor()
|
||||||
Defined in src/app/data-dgql/query.ts:536
|
||||||
The current pagination cursor (a node relative to which items will be loaded). Nullable.
Returns :
NodeId
|
||||||
setcursor(c: NodeId)
|
||||||
Defined in src/app/data-dgql/query.ts:539
|
||||||
Parameters :
Returns :
void
|
count | ||||||
getcount()
|
||||||
Defined in src/app/data-dgql/query.ts:545
|
||||||
The max amount of items to be loaded.
Returns :
number
|
||||||
setcount(c: number)
|
||||||
Defined in src/app/data-dgql/query.ts:548
|
||||||
Parameters :
Returns :
void
|
forward | ||||||
getforward()
|
||||||
Defined in src/app/data-dgql/query.ts:554
|
||||||
Whether to load items after the cursor (true), or items before the cursor (false).
Returns :
boolean
|
||||||
setforward(f: boolean)
|
||||||
Defined in src/app/data-dgql/query.ts:557
|
||||||
Parameters :
Returns :
void
|
firstPageItemId |
getfirstPageItemId()
|
Defined in src/app/data-dgql/query.ts:563
|
Returns the node ID of the first item on the current page.
Returns :
NodeId | null
|
lastPageItemId |
getlastPageItemId()
|
Defined in src/app/data-dgql/query.ts:569
|
Returns the node ID of the last item on the current page.
Returns :
NodeId | null
|
hasPrevPage |
gethasPrevPage()
|
Defined in src/app/data-dgql/query.ts:582
|
hasNextPage |
gethasNextPage()
|
Defined in src/app/data-dgql/query.ts:585
|