Skip to main content

ModelAnyRef

@webda/models


Class: ModelAnyRef<T>

Defined in: packages/models/src/polymorphic.ts:78

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/src/polymorphic.ts:92

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/src/polymorphic.ts:86

Key


model​

readonly model: string

Defined in: packages/models/src/polymorphic.ts:82

Model

Methods​

get()​

get(): Promise<T>

Defined in: packages/models/src/polymorphic.ts:110

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/src/polymorphic.ts:120

Serialize this instance to a JSON-compatible value

Returns​

ModelLinkData

the stored identity and custom properties