Current implementantion doesnt react to changes inside errors object. Once the validation has occur by validate function than it doents react on object changes.
The scenario is:
Validate invalid data
Change data which is validated by server validator function and remove error by removeError method. Now is isValid set to true
Revalidate form by sending request to server and addError. Now problem occur. isValid is not recomputed and validate method still returns true...
I think better implementation would be, which solves my problem:
import { keys } from "mobx";
@computed get isValid() {
return keys(this.errors).length === 0;
}
Hi, inside ManualEntityValidator at computed
isValid
method is an error. https://github.com/eManPrague/frui.ts/blob/develop/packages/validation/src/manualEntityValidator.ts#L30Current implementantion doesnt react to changes inside
errors
object. Once the validation has occur byvalidate
function than it doents react on object changes.The scenario is:
removeError
method. Now isisValid
set to trueisValid
is not recomputed andvalidate
method still returns true...I think better implementation would be, which solves my problem: