You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.
Why this feature is required (specific use-cases will be appreciated)?
One of the main reasons (I believe) of indicative's schema format is that it is serializable. So, the same validation schema can be used on the backend, and in frontend forms.
If this lib is expected to be used on frontend, it is also expected to be used with React, and react expects objects not to be mutated.
constsource={someNumber: "3"}constschema={someNumber: "number"}constcast=awaitvalidateAll(source,schema)// in the end of this code, source is { someNumber: 3 }
I'd expect the source not to be mutated, and cast to contain a copy of source with the casts applied.
Have you tried any other work arounds?
In my project, the workaround was to wrap indicative with immer. Something like this.
Why this feature is required (specific use-cases will be appreciated)?
One of the main reasons (I believe) of indicative's schema format is that it is serializable. So, the same validation schema can be used on the backend, and in frontend forms.
If this lib is expected to be used on frontend, it is also expected to be used with React, and react expects objects not to be mutated.
I'd expect the source not to be mutated, and
cast
to contain a copy ofsource
with the casts applied.Have you tried any other work arounds?
In my project, the workaround was to wrap indicative with
immer
. Something like this.Are you willing to work on it with little guidance?
I could, but it may take some time...
The text was updated successfully, but these errors were encountered: