Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PaginatedListState<T, P>

Type parameters

Hierarchy

Index

Constructors

Protected constructor

  • new PaginatedListState<T, P>(params?: P, page?: number, pageSize?: number): PaginatedListState<T, P>

Properties

Protected initialLoading

initialLoading: boolean = false

Protected loadingNext

loadingNext: boolean = false

Protected loadingPrev

loadingPrev: boolean = false

Protected location

Protected pageSize

pageSize: number

Protected pages

pages: Page<T>[] = []

Protected params

params: P = ...

Accessors

Abstract type

  • get type(): string

Methods

clear

  • clear(): void

Protected getAllItems

  • getAllItems(): T[]

getLocation

Protected getNextPageNumber

  • getNextPageNumber(): number

getPages

  • getPages(): Page<T>[]

getParams

  • getParams(): P

Protected getPrevPageNumber

  • getPrevPageNumber(): number

hasItems

  • hasItems(): boolean

hasNext

  • hasNext(): boolean

hasPrev

  • hasPrev(): boolean

isEmpty

  • isEmpty(): boolean
  • Returns true when there aren't any items and the state has already done its initial loading. If you want to know whether there are items regardless of load state, use hasItems() instead

    see

    hasItems

    Returns boolean

isInitialLoading

  • isInitialLoading(): boolean

isLoading

  • isLoading(): boolean

isLoadingNext

  • isLoadingNext(): boolean

isLoadingPrev

  • isLoadingPrev(): boolean

loadNext

Protected loadPage

loadPrev

Protected paramsChanged

  • paramsChanged(newParams: P): boolean

Protected parseResults

refresh

  • refresh(page?: number): Promise<void>

refreshParams

  • refreshParams(newParams: P, page: number): Promise<void>
  • Update the this.params object, calling refresh if they have changed. Use requestParams for converting this.params into API parameters

    see

    requestParams

    Parameters

    • newParams: P
    • page: number

    Returns Promise<void>

Protected requestParams

Generated using TypeDoc version 0.22.10