addObserver
Adds an observer to the path observer.toObserve to update the validation state via observer.updateState whenever an event with a path matching observer.toObserve occurs.
If an event path matches multiple observers, only the first observer will be called.
Note: This method must only be called during the initialization of the class.
protected fun <TValue> addObserver(pathToObserve: Path, updateState: UpdateStateFn<TValue, TState>)(source)
protected fun <TValue> addObserver(pathToObserve: String, updateState: UpdateStateFn<TValue, TState>)(source)
Adds an observer to the path pathToObserve to update the validation state via updateState whenever an event with a path matching pathToObserve occurs.
If an event path matches multiple observers, only the first observer will be called.
Note: This method must only be called during the initialization of the class.