Function: useReActiveModel()
ts
function useReActiveModel<T>(
modelName: Extract<T, string>,
): ReactiveModelConstructor<
any,
any,
string,
Record<string, RelationshipConfiguration>,
Required<{} | undefined>
>;Injects and returns a specific model constructor from the Vue ReActiveRecord database.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends string | number | symbol | The key of the model in your VueReActiveRecordTypes.ObjectMap. |
Parameters
| Parameter | Type | Description |
|---|---|---|
modelName | Extract<T, string> | The name of the model to retrieve from the database. |
Returns
ReactiveModelConstructor<any, any, string, Record<string, RelationshipConfiguration>, Required< | { } | undefined>>
The injected model constructor corresponding to the given model name.
Throws
If the database constructor is not found in the current Vue context, or if the specified model is not defined in your configuration.