FeathersResponseStrategy
ArchivedThese are the docs for ng-qubee 3.8. Read the 4.0 docs for @qubeejs/angular.
Defined in: src/lib/strategies/feathers-response.strategy.ts:37
Response strategy for the FeathersJS driver
Parses the paginated envelope emitted by Feathers database adapters:
{ "total": 48, "limit": 10, "skip": 10, "data": [...]}The envelope is offset-based — no page number, no navigation URLs — so position derives arithmetically:
currentPageisskip / limit + 1(integer division; a zero or missinglimitfalls back to page 1).perPagecomes straight fromlimit;lastPageisceil(total / limit).from/toare 1-indexed offsets derived fromskipand the item count of the current page (from = skip + 1,to = skip + data.length); both stayundefinedon an empty page.
The data / total / limit key names are configurable through
FeathersResponseOptions; the skip key is fixed by the Feathers
envelope and lives as a private static.
https://feathersjs.com/api/databases/common#pagination
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FeathersResponseStrategy():
FeathersResponseStrategy
Returns
Section titled “Returns”FeathersResponseStrategy
Methods
Section titled “Methods”paginate()
Section titled “paginate()”paginate<
T>(response,options):PaginatedCollection<T>
Defined in: src/lib/strategies/feathers-response.strategy.ts:54
Parse a Feathers pagination response into a PaginatedCollection
Type Parameters
Section titled “Type Parameters”T extends IPaginatedObject
Parameters
Section titled “Parameters”response
Section titled “response”Record<string, any>
The raw API response body
options
Section titled “options”The response key name configuration
Returns
Section titled “Returns”A typed PaginatedCollection instance