@aws-amplify/ui-react-core 3.3.4 → 3.3.5
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.
|
@@ -21,7 +21,7 @@ function useDataState(action, initialData, options) {
|
|
|
21
21
|
const pendingId = React__default.useRef();
|
|
22
22
|
const { onSuccess, onError } = options ?? {};
|
|
23
23
|
const handleAction = React__default.useCallback((input) => {
|
|
24
|
-
const id =
|
|
24
|
+
const id = Symbol();
|
|
25
25
|
pendingId.current = id;
|
|
26
26
|
setDataState(({ data }) => ({ ...LOADING_STATE, data }));
|
|
27
27
|
resolveMaybeAsync(action(prevData.current, input))
|
package/dist/index.js
CHANGED
|
@@ -575,7 +575,7 @@ function useDataState(action, initialData, options) {
|
|
|
575
575
|
const pendingId = React__namespace["default"].useRef();
|
|
576
576
|
const { onSuccess, onError } = options ?? {};
|
|
577
577
|
const handleAction = React__namespace["default"].useCallback((input) => {
|
|
578
|
-
const id =
|
|
578
|
+
const id = Symbol();
|
|
579
579
|
pendingId.current = id;
|
|
580
580
|
setDataState(({ data }) => ({ ...LOADING_STATE, data }));
|
|
581
581
|
resolveMaybeAsync(action(prevData.current, input))
|
package/package.json
CHANGED
|
@@ -32,13 +32,13 @@ export default function useDataState<T, K>(
|
|
|
32
32
|
}));
|
|
33
33
|
|
|
34
34
|
const prevData = React.useRef(initialData);
|
|
35
|
-
const pendingId = React.useRef<
|
|
35
|
+
const pendingId = React.useRef<Symbol | undefined>();
|
|
36
36
|
|
|
37
37
|
const { onSuccess, onError } = options ?? {};
|
|
38
38
|
|
|
39
39
|
const handleAction: (input: K) => void = React.useCallback(
|
|
40
40
|
(input) => {
|
|
41
|
-
const id =
|
|
41
|
+
const id = Symbol();
|
|
42
42
|
pendingId.current = id;
|
|
43
43
|
|
|
44
44
|
setDataState(({ data }) => ({ ...LOADING_STATE, data }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useDataState(): void;
|