Skip to main content

ModelAnyRef

@webda/core


Class: ModelAnyRef<T>

Defined in: packages/models/lib/polymorphic.d.ts:32

Reference whose get() always delegates to the application's permission-aware loader.

Type Parameters​

T​

T extends Storable = Storable

Constructors​

Constructor​

new ModelAnyRef<T>(reference): ModelAnyRef<T>

Defined in: packages/models/lib/polymorphic.d.ts:45

Create a new ModelAnyRef instance

Parameters​

reference​

ModelLinkData

serialized reference and custom properties

Returns​

ModelAnyRef<T>

Properties​

key​

readonly key: PolymorphicKey

Defined in: packages/models/lib/polymorphic.d.ts:40

Key


model​

readonly model: string

Defined in: packages/models/lib/polymorphic.d.ts:36

Model

Methods​

get()​

get(): Promise<T>

Defined in: packages/models/lib/polymorphic.d.ts:50

Read the target as the current caller; no target object is cached.

Returns​

Promise<T>

the readable target, or rejects like an ordinary model read


toJSON()​

toJSON(): ModelLinkData

Defined in: packages/models/lib/polymorphic.d.ts:55

Serialize this instance to a JSON-compatible value

Returns​

ModelLinkData

the stored identity and custom properties