Skip to content
module@warp-drive/legacy/compat @legacy

Interface LegacyStoreCompat

Defined in: warp-drive-packages/legacy/src/compat.ts:31

No Inherit Doc Legacy

Extends the signature of Store with additional methods available when using the legacy network layer.

Extends

  • Store$1

Indexable

ts
[key: string]: any

Methods

adapterFor()

Call Signature

ts
adapterFor(this, modelName): MinimumAdapterInterface;

Defined in: warp-drive-packages/legacy/src/compat.ts:41

Returns the adapter instance for the given model type, instantiating it (and caching the instance) if necessary. See adapterFor.

Parameters
this

Store$1

modelName

string

Returns

MinimumAdapterInterface

Call Signature

ts
adapterFor(
   this, 
   modelName, 
   _allowMissing
): MinimumAdapterInterface | undefined;

Defined in: warp-drive-packages/legacy/src/compat.ts:47

Same as the single-argument overload, but returns undefined instead of throwing/asserting when _allowMissing is true and no adapter is found.

Parameters
this

Store$1

modelName

string

_allowMissing

true

Returns

MinimumAdapterInterface | undefined


normalize()

ts
normalize(modelName, payload): ObjectValue;

Defined in: warp-drive-packages/legacy/src/compat.ts:59

Normalizes a payload for the given model type using its serializer. See normalize.

Parameters

modelName

string

payload

ObjectValue

Returns

ObjectValue


pushPayload()

ts
pushPayload(modelName, payload): void;

Defined in: warp-drive-packages/legacy/src/compat.ts:65

Pushes a payload into the store using the appropriate serializer to normalize it first. See pushPayload.

Parameters

modelName

string

payload

ObjectValue

Returns

void


serializeRecord()

ts
serializeRecord(record, options?): unknown;

Defined in: warp-drive-packages/legacy/src/compat.ts:70

Serializes a record using its serializer. See serializeRecord.

Parameters

record

unknown

options?

SerializerOptions

Returns

unknown


serializerFor()

ts
serializerFor<K>(modelName, _allowMissing?): MinimumSerializerInterface | null;

Defined in: warp-drive-packages/legacy/src/compat.ts:53

Returns the serializer instance for the given model type, instantiating it (and caching the instance) if necessary. See serializerFor.

Type Parameters

K

K extends string

Parameters

modelName

K

_allowMissing?

boolean

Returns

MinimumSerializerInterface | null

Released under the MIT License.