useModelInfo
Overview
Provides a reactive object for a given app and model. This composition function is designed to preserve deep references within the info object, preventing them from breaking when the app or model changes. If info were simply a ref, deep references would not update automatically with changes to the app or model.
This function deeply mirrors (watches and clones) the model information, which assumes that the model info has low churn. Frequent updates could have performance implications due to the deep cloning process.
Signature
useModelInfo(app, model, isActive)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| app | string | Ref | yes | A ref containing the app name that is being watched. |
| model | string | Ref | yes | A ref containing the model name that is being watched. |
| isActive | Readonly | no | An IsActive instance, if one can be reused. |
Returns
An object containing reactive fields and actions for model info.
Source
client/lib/use/useModelInfo.js:42