@pdg/react-hook 1.0.14 → 1.0.15
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/dist/index.esm.js +4 -4
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -13,7 +13,7 @@ function useAutoUpdateState(state, callback) {
|
|
|
13
13
|
var _a = useState(function () { return (callback ? callback(state) : state); }), _value = _a[0], _setValue = _a[1];
|
|
14
14
|
useFirstSkipEffect(function () {
|
|
15
15
|
_setValue(callback ? callback(state) : state);
|
|
16
|
-
}, [state
|
|
16
|
+
}, [state]);
|
|
17
17
|
var setValue = useCallback(function (newValue, skipCallback) {
|
|
18
18
|
var finalNewValue = newValue;
|
|
19
19
|
if (typeof finalNewValue === 'function') {
|
|
@@ -45,7 +45,7 @@ function useAutoUpdateLayoutState(state, callback) {
|
|
|
45
45
|
var _a = useState(function () { return (callback ? callback(state) : state); }), _value = _a[0], _setValue = _a[1];
|
|
46
46
|
useFirstSkipLayoutEffect(function () {
|
|
47
47
|
_setValue(callback ? callback(state) : state);
|
|
48
|
-
}, [state
|
|
48
|
+
}, [state]);
|
|
49
49
|
var setValue = useCallback(function (newValue, skipCallback) {
|
|
50
50
|
var finalNewValue = newValue;
|
|
51
51
|
if (typeof finalNewValue === 'function') {
|
|
@@ -72,7 +72,7 @@ function useAutoUpdateRefState(state, callback) {
|
|
|
72
72
|
valueRef.current = newValue;
|
|
73
73
|
_setValue(newValue);
|
|
74
74
|
}
|
|
75
|
-
}, [state
|
|
75
|
+
}, [state]);
|
|
76
76
|
var setValue = useCallback(function (newValue, skipCallback) {
|
|
77
77
|
var finalNewValue = newValue;
|
|
78
78
|
if (typeof finalNewValue === 'function') {
|
|
@@ -100,7 +100,7 @@ function useAutoUpdateLayoutRefState(state, callback) {
|
|
|
100
100
|
valueRef.current = newValue;
|
|
101
101
|
_setValue(newValue);
|
|
102
102
|
}
|
|
103
|
-
}, [state
|
|
103
|
+
}, [state]);
|
|
104
104
|
var setValue = useCallback(function (newValue, skipCallback) {
|
|
105
105
|
var finalNewValue = newValue;
|
|
106
106
|
if (typeof finalNewValue === 'function') {
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ function useAutoUpdateState(state, callback) {
|
|
|
13
13
|
var _a = react.useState(function () { return (callback ? callback(state) : state); }), _value = _a[0], _setValue = _a[1];
|
|
14
14
|
useFirstSkipEffect(function () {
|
|
15
15
|
_setValue(callback ? callback(state) : state);
|
|
16
|
-
}, [state
|
|
16
|
+
}, [state]);
|
|
17
17
|
var setValue = react.useCallback(function (newValue, skipCallback) {
|
|
18
18
|
var finalNewValue = newValue;
|
|
19
19
|
if (typeof finalNewValue === 'function') {
|
|
@@ -45,7 +45,7 @@ function useAutoUpdateLayoutState(state, callback) {
|
|
|
45
45
|
var _a = react.useState(function () { return (callback ? callback(state) : state); }), _value = _a[0], _setValue = _a[1];
|
|
46
46
|
useFirstSkipLayoutEffect(function () {
|
|
47
47
|
_setValue(callback ? callback(state) : state);
|
|
48
|
-
}, [state
|
|
48
|
+
}, [state]);
|
|
49
49
|
var setValue = react.useCallback(function (newValue, skipCallback) {
|
|
50
50
|
var finalNewValue = newValue;
|
|
51
51
|
if (typeof finalNewValue === 'function') {
|
|
@@ -72,7 +72,7 @@ function useAutoUpdateRefState(state, callback) {
|
|
|
72
72
|
valueRef.current = newValue;
|
|
73
73
|
_setValue(newValue);
|
|
74
74
|
}
|
|
75
|
-
}, [state
|
|
75
|
+
}, [state]);
|
|
76
76
|
var setValue = react.useCallback(function (newValue, skipCallback) {
|
|
77
77
|
var finalNewValue = newValue;
|
|
78
78
|
if (typeof finalNewValue === 'function') {
|
|
@@ -100,7 +100,7 @@ function useAutoUpdateLayoutRefState(state, callback) {
|
|
|
100
100
|
valueRef.current = newValue;
|
|
101
101
|
_setValue(newValue);
|
|
102
102
|
}
|
|
103
|
-
}, [state
|
|
103
|
+
}, [state]);
|
|
104
104
|
var setValue = react.useCallback(function (newValue, skipCallback) {
|
|
105
105
|
var finalNewValue = newValue;
|
|
106
106
|
if (typeof finalNewValue === 'function') {
|