LimitOffsetPaginator

Source
import { LimitOffsetPaginator } from "@prestojs/util";
Hierarchy
  • Paginator<
    An object with these properties:
    PropertyTypeDescription
    limitnumber|string
    offsetnumber|string
    ,
    An object with these properties:
    PropertyTypeDescription
    totalnumber|null
    >
  • LimitOffsetPaginator

API

Constructor

new LimitOffsetPaginator(?currentStatePair,?internalStatePair)

Arguments:

ArgumentTypeDescription
currentStatePairnull
internalStatePairnull

Methods

first()
Returns:void
firstState()
Returns:
An object with these properties:
PropertyTypeDescription
limitnumber|string
offsetnumber|string
getRequestInit(props)

Arguments:

ArgumentTypeDescription
*propsObject
Returns:
An object with these properties:
PropertyTypeDescription
headersHeadersInit|Record
queryRecord
urlArgsRecord
...any
Any properties from RequestInit except for these:
  • headers
hasNextPage()
Returns:boolean
last()
Returns:void
lastState()
Returns:null|
An object with these properties:
PropertyTypeDescription
limitnumber|string
offsetnumber|string
limitState(limit)

Arguments:

ArgumentTypeDescription
*limitnull|number
Returns:
An object with these properties:
PropertyTypeDescription
limitnumber|string
offsetnumber|string
next()
Returns:void
nextState()
Returns:null|
An object with these properties:
PropertyTypeDescription
limitnumber|string
offsetnumber|string
offsetState(offset)

Arguments:

ArgumentTypeDescription
*offsetnull|number
Returns:
An object with these properties:
PropertyTypeDescription
limitnumber|string
offsetnumber|string
previous()
Returns:void
previousState()
Returns:null|
An object with these properties:
PropertyTypeDescription
limitnumber|string
offsetnumber|string
replaceStateControllers(currentStatePair,internalStatePair)

Arguments:

ArgumentTypeDescription
*currentStatePairany
*internalStatePairany
Returns:void
setCurrentState(set)

Component Props:

PropTypeDescription
*set
setInternalState(set)

Component Props:

PropTypeDescription
*set
setLimit(limit)

Arguments:

ArgumentTypeDescription
*limitnull|number
Returns:void
setOffset(offset)

Arguments:

ArgumentTypeDescription
*offsetnull|number
Returns:void
setResponse(props)

Arguments:

ArgumentTypeDescription
*propsObject
Returns:void

Properties

currentState

Source
An object with these properties:
PropertyTypeDescription
limitnumber|string
offsetnumber|string

internalState

Source
An object with these properties:
PropertyTypeDescription
responseIsSetboolean
totalnumber|null

limit

Source
null|number

offset

Source
number

responseIsSet

Source
boolean

total

Source
null|number

Static Methods

getPaginationState(requestDetails)

Arguments:

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