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

Function modelFor() ​

ts
function modelFor<T>(type: TypeFromInstance<T>): void | typeof Model;
function modelFor(type: string): void | typeof Model;

Call Signature ​

ts
function modelFor<T>(type: TypeFromInstance<T>): void | typeof Model;

Defined in: warp-drive-packages/legacy/src/model/-private/hooks.ts:76

The modelFor implementation for use with Model, exposed on the store as store.modelFor(type) when the store is configured to use Model. Returns the Model subclass registered for the given type, if any.

Type Parameters ​

T ​

T

Parameters ​

type ​

TypeFromInstance<T>

Returns ​

void | typeof Model

Call Signature ​

ts
function modelFor(type: string): void | typeof Model;

Defined in: warp-drive-packages/legacy/src/model/-private/hooks.ts:82

Overload accepting a raw type string instead of a typed record instance.

Parameters ​

type ​

string

Returns ​

void | typeof Model

Released under the MIT License.