Validates a document without waiting for idle time, for as long as enabled is true, including
a validation already in progress. Meant for the moment a user is waiting on the result, such as
a publish that waits for validation to finish.
This can hurt the studio's responsiveness. While it is enabled, every validation of the document,
including the ones later edits start, competes with rendering and input for the main thread.
Validation still hands the thread back to the browser now and then, but on a large document
typing and scrolling can feel sluggish until it is done. Enable it only while someone is
waiting, and disable it as soon as they no longer are.
It switches the document's shared validation, so pass the same arguments as
useValidationStatus, its listener included: every useValidationStatus of that document
and listener gets the results sooner, and validation stays immediate until every caller has
disabled it or unmounted. It reports no errors itself: if the document's validation fails, the
hold ends, and useValidationStatus reports the failure.
Each listener validates the document on its own, so a hold only speeds up the validation of its
own listener: one with the default, document, leaves a
useValidationStatus(id, type, {listener: 'global'}) validating in idle time, and the other way
around. A hold on a listener that no useValidationStatus reads validates through it anyway,
and with document that checks out the document pair.
Parameters
validationTargetId: string
docTypeName: string
_requirePublishedReferences: boolean
Deprecated
Ignored. Whether references must be published is decided by validationTargetId.
Validates a document without waiting for idle time, for as long as
enabledis true, including a validation already in progress. Meant for the moment a user is waiting on the result, such as a publish that waits for validation to finish.This can hurt the studio's responsiveness. While it is enabled, every validation of the document, including the ones later edits start, competes with rendering and input for the main thread. Validation still hands the thread back to the browser now and then, but on a large document typing and scrolling can feel sluggish until it is done. Enable it only while someone is waiting, and disable it as soon as they no longer are.
It switches the document's shared validation, so pass the same arguments as
useValidationStatus, itslistenerincluded: everyuseValidationStatusof that document and listener gets the results sooner, and validation stays immediate until every caller has disabled it or unmounted. It reports no errors itself: if the document's validation fails, the hold ends, anduseValidationStatusreports the failure.Each listener validates the document on its own, so a hold only speeds up the validation of its own
listener: one with the default,document, leaves auseValidationStatus(id, type, {listener: 'global'})validating in idle time, and the other way around. A hold on a listener that nouseValidationStatusreads validates through it anyway, and withdocumentthat checks out the document pair.