ResourceLister
Extends:
Paginated resource lister
Constructor Summary
Public Constructor | ||
public |
constructor(api: Mapcreator, route: string, Resource: Class<ResourceBase>, parameters: RequestParameters, maxRows: number, key: string) ResourceLister constructor |
Member Summary
Public Members | ||
public get |
Resource: Class<ResourceBase>: * Resource constructor accessor, used for building the resource instance |
|
public get |
api: Mapcreator: * Get the api instance |
|
public set |
autoUpdate(value: boolean) Set if ResourceLister#update should be called when ResourceLister#parameters is updated |
|
public get |
autoUpdate: * Get if ResourceLister#update should be called when ResourceLister#parameters is updated |
|
public get |
availableRows: number: * Get the number of rows the server has available |
|
public get |
Get the data |
|
public get |
Get if there are more resources to fetch. |
|
public get |
Get the maximum amount of rows allowed |
|
public set |
Set the maximum amount of rows allowed |
|
public get |
Get the request parameters |
|
public set |
parameters(object: RequestParameters) Set the request parameters |
|
public get |
Get the route (url) |
|
public get |
Get the row count |
|
public get |
Get if the instance is waiting for data |
Method Summary
Public Methods | ||
public |
[Symbol.iterator](): Iterator Returns the iterable |
|
public |
Same as |
|
public |
Push a row to the data collection |
|
public |
async update() Update the server data |
Public Constructors
public constructor(api: Mapcreator, route: string, Resource: Class<ResourceBase>, parameters: RequestParameters, maxRows: number, key: string) source
ResourceLister constructor
Params:
Name | Type | Attribute | Description |
api | Mapcreator | Api instance |
|
route | string | Resource url route |
|
Resource | Class<ResourceBase> | Resource constructor |
|
parameters | RequestParameters |
|
Request parameters |
maxRows | number |
|
Initial max rows |
key | string |
|
Key |
Public Members
public get Resource: Class<ResourceBase>: * source
Resource constructor accessor, used for building the resource instance
public set autoUpdate(value: boolean) source
Set if ResourceLister#update should be called when ResourceLister#parameters is updated
Throw:
public get autoUpdate: * source
Get if ResourceLister#update should be called when ResourceLister#parameters is updated
Throw:
public get hasMore: boolean: * source
Get if there are more resources to fetch. It indicates if the maxRows can be increased.
public set parameters(object: RequestParameters) source
Set the request parameters
If you set ResourceLister#autoUpdate to true then ResourceLister#update will automatically be called when the parameters are updated.
Throw:
Public Methods
public loadMore(rows: number) source
Same as this.maxRows += this.parameters.perPage
Params:
Name | Type | Attribute | Description |
rows | number |
|
Amount to increment maxRows with |