Paginator

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

API

Constructor

new Paginator(?currentStatePair,?internalStatePair)
Params:
ParameterTypeDescription
currentStatePairnull
internalStatePairnull

Methods

first()
Returns:void
firstState()
Returns:State
getRequestInit(options)
Params:
ParameterTypeDescription
*
options
An object with the properties below
options.headersHeadersInit|Record
options.queryRecord
options.urlArgsRecord
...any
Any properties from RequestInit
Returns:
An object with these properties:
PropertyTypeDescription
headersHeadersInit|Record
queryRecord
urlArgsRecord
...any
Any properties from RequestInit
hasNextPage()
Returns:boolean
next()
Returns:void
nextState()
Returns:null|State
previous()
Returns:void
previousState()
Returns:null|State
replaceStateControllers(currentStatePair,internalStatePair)
Params:
ParameterTypeDescription
*currentStatePairany
*internalStatePairany
Returns:void
setCurrentState(set)
Params:
ParameterTypeDescription
*setState
Returns:void
setInternalState(set)
Params:
ParameterTypeDescription
*setInternalState
Returns:void
setResponse(response)
Params:
ParameterTypeDescription
*responseRecord
Returns:void

Properties

currentState

Source
State

internalState

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

responseIsSet

Source
boolean