Skip to main content

lib/pagination

Api Code Documentation / Exports / lib/pagination

Table of contents

Interfaces

Functions

Functions

makePagination

makePagination<T>(route, records, currentChunk, limit, optionalParams): Pagination

Type parameters

Name
T

Parameters

NameType
routestring
recordsT[]
currentChunknumber
limitnumber
optionalParamsRecord<string, any>

Returns

Pagination

Defined in

src/lib/pagination.ts:12


paginate

paginate<T>(route, records, query): [T[], Pagination]

Type parameters

Name
T

Parameters

NameType
routestring
recordsT[]
queryObject
query.limitstring | number
query.order?string
query.pagestring | number
query.search?string
query.sort?string

Returns

[T[], Pagination]

Defined in

src/lib/pagination.ts:45