@paragrav/rhf-utils 0.0.22 → 0.0.23

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.
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * Calls a callback after a successful submit and after a form reset.
3
3
  *
4
+ * Use this when your forms use a isDirty prompter for user action that would lose unsaved data.
5
+ * You must reset form before you can navigate away from page.
6
+ *
4
7
  * Using RHF and following its rules, we are not able to get the state `isSubmitSuccessful=true` and `isDirty=false`.
5
8
  * So, this has to keep track of previous state.
6
9
  *
package/dist/utils.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const i = (t) => JSON.stringify(t) === "{}";
1
+ const e = (t) => Object.keys(t).length === 0;
2
2
  export {
3
- i as isEmptyObject
3
+ e as isEmptyObject
4
4
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@paragrav/rhf-utils",
3
3
  "author": "paragrav.dev",
4
4
  "license": "MIT",
5
- "version": "0.0.22",
5
+ "version": "0.0.23",
6
6
  "description": "Integration utilities for react-hook-form.",
7
7
  "type": "module",
8
8
  "sideEffects": false,