Skip to content

useModelInitialValues ​

Overview ​

Returns the initial values for a model, so that a blank form can be created, without fields being mutated immediately by coercion of values, causing a form to be dirty.

Signature ​

useModelInitialValues(app, model, fields)

Parameters ​

NameTypeRequiredDescription
appRefyesA ref containing the app name that is being watched.
modelRefyesA ref containing the model name that is being watched.
fieldsRefyesA ref containing the field names to display.

Returns ​

Readonly

An object containing the initial values for the model.

Source ​

client/lib/use/useModelInitialValues.js:133