Type parameter | Description |
---|---|
QueryType |
The type of the data fetch query, for instance, search strings or filter crieteria. |
ItemType |
The type of each item to be returned from the fetch. |
Data Query-specific options
Development-time settings
Data Query-specific options
Returns the last successful query whose current results are based on. For the query used in the most recent fetch attempt, including failed fetches, use attemptedQuery.
Returns the query of the last attempted fetch. If the fetch is pending, this would be the pending query. If the fetch is complete and successful, this is the same as activeQuery.
Returns true if there are more items to fetch, which means one of the following:
isDone
.total
returned from a fetch.If no successful fetch has ever happened with the last attempted query,
then this returns null
.
Returns true if the last completed fetch encountered an error.
Returns true if data fetch is currently happening.
Gets the items of the most recent successful fetch. This is an empty array if no successful fetch has ever happened. Note that if the most recent failed fetch is of a different query, this still holds data from the successful fetch that may be from a different query.
Returns the UI state's debug name.
Returns the number of total items, once this is known. If the fetch function
returns either isDone
or total
(see FetchResultWithStats), the number will
be respectively be the number of items so far, or the total number.
In case the number is not known, this returns null
.
Cancel any on-going data fetch. This will cause the fetch to fail. If the current fetch is a new query, the items will not clear.
Cancels any pending fetch, and restores the data query into the initial state. This forgets all of the previous results and queries.
Starts fetchin data. The supplied query will be the attempted query and the fetch will start from offset zero always.
The query to fetch with.
If force
is given, any pending fetch will be canceled
and a new one started even if the given query is identical to that of the
pending fetch.
Fetches more items using the current query. The fetch function configured in DataQueryOptions will receive an offset that is the number of items currently.
The method can also be used for retrying a failed fetch of a new query. In this case, the offset will be zero (rather than the count of the results from a different query).
This method is no-op if there has never been an attempted query.
Generated using TypeDoc
Represents an incremental data query state such as that of infinite scrollers or auto-complete dropdowns.
The class can fetch data using any arbitrary fetch function, depending on any arbitrary fetch query. The pending state of the fetch, the last successful fetch query and result, as well as the data total statistics are available.