IResponseStrategy
ArchivedThese are the docs for ng-qubee 3.8. Read the 4.0 docs for @qubeejs/angular.
Defined in: src/lib/interfaces/response-strategy.interface.ts:12
Strategy interface for parsing paginated API responses
Each driver implements this interface to parse responses from the corresponding backend format into a PaginatedCollection.
Methods
Section titled “Methods”paginate()
Section titled “paginate()”paginate<
T>(response,options,headers?):PaginatedCollection<T>
Defined in: src/lib/interfaces/response-strategy.interface.ts:26
Parse a raw API response into a typed PaginatedCollection
Type Parameters
Section titled “Type Parameters”T extends IPaginatedObject
Parameters
Section titled “Parameters”response
Section titled “response”Record<string, unknown>
The raw API response object (body). For drivers that emit a bare array body (e.g. PostgREST), pass the array here.
options
Section titled “options”The response key name configuration
headers?
Section titled “headers?”Optional HTTP response headers. Drivers that carry
pagination metadata in headers (PostgREST’s Content-Range) read from
this bag; body-only drivers ignore it. Accepts anything with a .get()
accessor (HttpHeaders, Headers) or a plain Record<string, string>.
Returns
Section titled “Returns”A typed PaginatedCollection instance