Home Manual Reference Source Repository
import ResourceProxy from '@mapcreator/api/src/proxy/ResourceProxy.js'
protected class | source

ResourceProxy

Extends:

SimpleResourceProxy → ResourceProxy

Direct Subclass:

GeoResourceProxy

Proxy for accessing resource. This will make sure that they are properly wrapped before the promise resolves.

Method Summary

Public Methods
public

Get target resource

public

Select target resource without obtaining data

Inherited Summary

From class SimpleResourceProxy
public get

Target: Class<ResourceBase>: *

Target to wrap results in

public get

api: Mapcreator: *

Get api instance

public get

Proxy target url

public

List target resource

public

Get the resource lister

public

Build a new instance of the target

Public Methods

public get(id: Number | String | Object, deleted: String): CancelablePromise<ResourceBase> source

Get target resource

Params:

NameTypeAttributeDescription
id Number | String | Object
  • optional
  • default:

The resource id to be requested

deleted String
  • optional
  • default: null

Determines if the resource should be shown if deleted, requires special resource permissions. Possible values: only, none, all

Return:

CancelablePromise<ResourceBase>

Target resource

Throw:

ApiError

If the api returns errors

public select(id: Number | String): ResourceBase source

Select target resource without obtaining data

Params:

NameTypeAttributeDescription
id Number | String
  • optional
  • default:

Resource id

Return:

ResourceBase

Empty target resource

Example:

api.users.select('me').colors().then(doSomethingCool);