IObservableNode interface
đ Descriptionâ
Interface that describes the observable nodes with in Moment.
đ Type declarationâ
interface IObservableNode { id: string;Readonly key: string;Readonly node: Node;Readonly props: INode;Readonly block: NodeBlock | undefined;Readonly context: Context;Readonly collectsData: boolean;Readonly hasDataCollected: boolean;Readonly enumerator: number | undefined;Readonly validation: "unknown" | "pass" | "fail";Readonly isFailed: boolean;Readonly isPassed: boolean;Readonly observer: Await | undefined;Readonly hasChanged: (bReset?: boolean) => boolean;Function }
đī¸ Propertiesâ
đˇī¸ blockâ
Reference to the node block instance.
When no block is attached to the node, this property is undefined.
Typeâ
NodeBlock | undefined
đˇī¸ collectsDataâ
Specifies if the node collects data.
Typeâ
boolean
đˇī¸ contextâ
Reference to the context.
Typeâ
đˇī¸ enumeratorâ
Contains the enumerator for the node. Enumerators are only granted to nodes that have a block that collects data.
Typeâ
number | undefined
đˇī¸ hasDataCollectedâ
Specifies if the node has collected data.
Typeâ
boolean
đˇī¸ idâ
Contains a unique identifier for the node.
Typeâ
string
đˇī¸ isFailedâ
Retrieves if the validation of the node failed.
Typeâ
boolean
đˇī¸ isPassedâ
Retrieves if the validation of the node passed.
Typeâ
boolean
đˇī¸ keyâ
Contains a unique key for the node within the current context (the key is prefixed with an underscore).
Typeâ
string
đˇī¸ nodeâ
Reference to the node.
Typeâ
đˇī¸ observerâ
Reference to the node observer. Can be used to trigger a validation cycle for node.
Typeâ
đˇī¸ propsâ
Reference to the node properties.
Typeâ
đˇī¸ validationâ
Retrieves the validation state of the node. It can be one of the following values:
unknown: There is no validation state available yet;pass: Validation succeeded;fail: Validation failed.
Typeâ
"unknown" | "pass" | "fail"
âļī¸ Functionsâ
đ§ hasChangedâ
Function to retrieve if the node has changed and needs to be rerendered. This reads out a flag that is set to true whenever a node changes. The function accepts an optional reset argument. When true is supplied to that argument, the flag will reset to false. Any subsequent call to this function will then return false until another change is made to the form.
Signatureâ
(reset?: boolean) => boolean
Parametersâ
| Name | Type | Optional | Description |
|---|---|---|---|
reset | boolean | Yes | Specifies if the change flag should reset (default is false). |
Return valueâ
Returns true if the node has changed.