Skip to content

self-assert / DraftViewer

Interface: DraftViewer<Model> ​

Changes to a draft can be observed by viewers.

Viewers can be notified about changes to the draft or about failed assertions.

Type Parameters ​

Type ParameterDefault type
Modelany

Draft viewers ​

onDraftChanged()? ​

optional onDraftChanged: (aModel) => void

Receives notifications about changes to the draft's model.

Parameters ​

ParameterType
aModelModel

Returns ​

void


onFailure()? ​

optional onFailure: (aFailedAsserion) => void

Receives notifications about failed assertions.

Parameters ​

ParameterType
aFailedAsserionLabeledRule

Returns ​

void


onFailuresReset()? ​

optional onFailuresReset: () => void

Receives notifications when the model's failed assertions are cleared.

Returns ​

void