Skip to content

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

NameTypeRequiredDescription
appstring | RefyesA ref containing the app name that is being watched.
modelstring | RefyesA ref containing the model name that is being watched.
isActiveReadonlynoAn 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

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2