Validating Store
A ValidatingStore is a RootStore which also contains a Validation for its model and by default applies it to every update.
This store is intentionally configured to validate the data on each update, that is why the validateAfterUpdate parameter is set to true by default.
There might be special situations where it is reasonable to disable this behaviour by setting validateAfterUpdate to false and to prefer applying the validation individually within custom handlers, for example if a model should only be validated after the user has completed his input or if metadata is needed for the validation process. Then be aware of the fact, that the call of the validate function actually updates the messages already.
If the new data is not passed to the store's state after validating it, the messages are probably out of sync with the actual store's state! This could lead to false assumptions and might produce hard to detect bugs in your application.
Parameters
Constructors
Functions
Default error handler printing the error to console.
Factory method to create a SimpleHandler that does not take an Action
Factory method to create a SimpleHandler mapping the actual value of the Store and a given Action to a new value.
factory method to create an EmittingHandler that does not take an action in it's execute-lambda.
Factory method to create a EmittingHandler taking an action-value and the current store value to derive the new value. An EmittingHandler is a Flow by itself and can therefore be connected to other SimpleHandlers even in other Stores.
Properties
a simple SimpleHandler that just takes the given action-value as the new value for the Store.