Home Manual Reference Source
import PaginatedResourceListing from '@mapcreator/maps4news/src/PaginatedResourceListing.js'
public class | source

PaginatedResourceListing

Proxy for accessing paginated resources

Member Summary

Public Members
public get

Target to wrap results in

public get

Get api instance

public get

Used for caching pages internally

public get

Page data

public get

Deleted items filter state

public set

deleted(value: String)

Deleted items filter state

public get

If there is a next page

public get

If there is a previous page

public get

page: Number: *

Current page number

public get

Amount of pages available

public get

Request parameters

public set

Request parameters

public get

Maximum amount of items per page

public get

Optional search query

public set

Optional search query

public get

Target route

public set

route(value: String)

Override the target route

public get

rows: Number: *

Row count

public get

sort: String: *

Set sort direction

public set

sort(value: String)

Current sorting value

Method Summary

Public Methods
public

Get target page

public

Get next page

public

Get previous page

public

Wraps PaginatedResourceWrapper around the page

Public Members

public get Target: ResourceBase: * source

Target to wrap results in

Return:

ResourceBase

Target constructor

public get api: Maps4News: * source

Get api instance

Return:

Maps4News

Api instance

public get cacheToken: string: * source

Used for caching pages internally

Return:

string

Cache token

See:

public get data: Array<ResourceBase>: * source

Page data

Return:

Array<ResourceBase>

Wrapped data

public get deleted: String: * source

Deleted items filter state

Return:

String

value - Deleted items filter state

See:

public set deleted(value: String) source

Deleted items filter state

See:

public get hasNext: boolean: * source

If there is a next page

Return:

boolean

If there is a next page

public get hasPrevious: boolean: * source

If there is a previous page

Return:

boolean

If there is a previous page

public get page: Number: * source

Current page number

Return:

Number

Current page

public get pageCount: Number: * source

Amount of pages available

Return:

Number

Page count

public get parameters: RequestParameters: * source

Request parameters

Return:

RequestParameters

Request parameters

public set parameters(value: RequestParameters) source

Request parameters

public get perPage: Number: * source

Maximum amount of items per page

Return:

Number

Amount of items

public get query: Object<String, String|Array<String>>: * source

Optional search query

Return:

Object<String, String|Array<String>>

Query

public set query(value: Object<String, String|Array<String>>) source

Optional search query

Throw:

TypeError

See:

  • ResourceProxy#search

public get route: String: * source

Target route

Return:

String

url

public set route(value: String) source

Override the target route

public get rows: Number: * source

Row count

Return:

Number

Row count

public get sort: String: * source

Set sort direction

Return:

String

Sort

Example:

const sort = ['-name', 'id']

public set sort(value: String) source

Current sorting value

Public Methods

public async getPage(page: Number, perPage: Number): Promise<PaginatedResourceListing> source

Get target page

Params:

NameTypeAttributeDescription
page Number

Page number

perPage Number

Amount of items per page (max 50)

Return:

Promise<PaginatedResourceListing>

Target page

Throw:

ApiError

public next(): Promise<PaginatedResourceListing> source

Get next page

Return:

Promise<PaginatedResourceListing>

paginated resource {

Throw:

ApiError

public previous(): Promise<PaginatedResourceListing> source

Get previous page

Return:

Promise<PaginatedResourceListing>

paginated resource {

Throw:

ApiError

public wrap(shareCache: Boolean): PaginatedResourceWrapper source

Wraps PaginatedResourceWrapper around the page

Params:

NameTypeAttributeDescription
shareCache Boolean

Share cache across instances

Return:

PaginatedResourceWrapper

Wrapped resource listing