@colisweb/rescript-toolkit 5.41.0 → 5.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "5.41.0",
3
+ "version": "5.41.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -81,6 +81,7 @@ module Make = (Config: Config) => {
81
81
  isDirty: bool,
82
82
  isValid: bool,
83
83
  setFormState: formState => unit,
84
+ hasValidationErrors: unit => bool,
84
85
  }
85
86
 
86
87
  type onSubmitAPI = {
@@ -527,6 +528,14 @@ module Make = (Config: Config) => {
527
528
  isDirty: state.formState == Dirty,
528
529
  isValid: state.formState == Valid,
529
530
  setFormState: formState => send(SetFormState(formState)),
531
+ hasValidationErrors: () => {
532
+ let recordState = ReSchema.validate(~i18n, state.values, schema)
533
+
534
+ switch recordState {
535
+ | Valid => false
536
+ | _ => true
537
+ }
538
+ },
530
539
  }
531
540
 
532
541
  interface