Paginator

Source
import { Paginator } from "@prestojs/util";
Paginator<State,InternalState>

API

Constructor

new Paginator(?currentStatePair,?internalStatePair)
Source

Arguments:

ArgumentTypeDescription
currentStatePairnull|[State, ]
internalStatePairnull|[State, ]

Methods

first()
Source
Returns:void
firstState()
Source
Returns:State
getRequestInit(options)
Source

Arguments:

ArgumentTypeDescription
*
options
An object with the properties below
options.bodynull|BodyInit
options.cacheRequestCache
options.credentialsRequestCredentials
options.headersHeadersInit|Record
options.integritystring
options.keepaliveboolean
options.methodstring
options.modeRequestMode
options.queryRecord
options.redirectRequestRedirect
options.referrerstring
options.referrerPolicyReferrerPolicy
options.signalnull|AbortSignal
options.urlArgsRecord
options.windownull
Returns:
An object with these properties:
PropertyTypeDescription
bodynull|BodyInit
cacheRequestCache
credentialsRequestCredentials
headersHeadersInit|Record
integritystring
keepaliveboolean
methodstring
modeRequestMode
queryRecord
redirectRequestRedirect
referrerstring
referrerPolicyReferrerPolicy
signalnull|AbortSignal
urlArgsRecord
windownull
hasNextPage()
Source
Returns:boolean
hasPreviousPage()
Source
Returns:boolean
next()
Source
Returns:void
nextState()
Source
Returns:null|State
previous()
Source
Returns:void
previousState()
Source
Returns:null|State
replaceStateControllers(currentStatePair,internalStatePair)
Source

Arguments:

ArgumentTypeDescription
*currentStatePair[State, ]
*internalStatePair[State, ]
Returns:void
setCurrentState(set)
Source

Arguments:

ArgumentTypeDescription
*setState
Returns:void
setInternalState(set)
Source

Arguments:

ArgumentTypeDescription
*setInternalState
Returns:void
setResponse(response)
Source

Arguments:

ArgumentTypeDescription
*responseRecord
Returns:void

Properties

currentState

Source
State

internalState

Source
An object with these properties:
PropertyTypeDescription
responseIsSetboolean
...any
Any properties from InternalState

responseIsSet

Source
boolean

Static Methods

getPaginationState(requestDetails)
Source

Arguments:

ArgumentTypeDescription
*
requestDetails
An object with the properties below
requestDetails.decodedBodyany
requestDetails.queryRecord
requestDetails.responseResponse
*requestDetails.urlstring
requestDetails.urlArgsRecord
Returns:false|Record