use-good-hooks 1.0.28 → 1.0.29

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,5 +1,7 @@
1
1
  import { DebounceSettings } from 'lodash';
2
2
 
3
+ export { DebounceSettings }
4
+
3
5
  declare type HistoryAction<T> = {
4
6
  type: 'CLEAR';
5
7
  initialPresent: T;
@@ -24,7 +26,7 @@ declare type HistoryState<T> = {
24
26
  };
25
27
 
26
28
  declare type UseHistoryOptionsState<T> = {
27
- debounceOptions?: DebounceSettings;
29
+ debounceSettings?: DebounceSettings;
28
30
  debounceTime?: number;
29
31
  maxCapacity?: number;
30
32
  onChange?: HistoryOnChange<T>;
@@ -66,9 +66,9 @@ const U = {
66
66
  } else
67
67
  throw new Error("Unsupported action type");
68
68
  }, v = (r, y) => {
69
- const { maxCapacity: s, debounceTime: n, debounceOptions: p, onChange: o } = y || {}, l = P(r), [e, t] = b(
70
- (i, a) => A({
71
- action: a,
69
+ const { maxCapacity: s, debounceTime: n, debounceSettings: p, onChange: o } = y || {}, l = P(r), [e, t] = b(
70
+ (i, O) => A({
71
+ action: O,
72
72
  maxCapacity: s,
73
73
  onChange: o,
74
74
  state: i
@@ -88,7 +88,7 @@ const U = {
88
88
  p
89
89
  ), w = d((i) => t({ type: "SET", newPresent: i }), []), E = d(() => {
90
90
  S && t({ type: "UNDO" });
91
- }, [S]), O = d(
91
+ }, [S]), a = d(
92
92
  (i) => {
93
93
  n ? m(i) : w(i);
94
94
  },
@@ -103,7 +103,7 @@ const U = {
103
103
  future: e.future
104
104
  },
105
105
  redo: D,
106
- set: O,
106
+ set: a,
107
107
  setDirect: w,
108
108
  state: e.present,
109
109
  undo: E
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  "test": "vitest",
50
50
  "test:coverage": "vitest --coverage"
51
51
  },
52
- "version": "1.0.28"
52
+ "version": "1.0.29"
53
53
  }