async-fetch 0.2.0 → 0.2.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/README.md +1 -1
- package/package.json +1 -1
- package/useAsyncFetch.js +7 -4
package/README.md
CHANGED
package/package.json
CHANGED
package/useAsyncFetch.js
CHANGED
|
@@ -17,6 +17,7 @@ function useAsyncFetch(props, props2) {
|
|
|
17
17
|
deps = [],
|
|
18
18
|
ignore,
|
|
19
19
|
poll,
|
|
20
|
+
ignoreCleanup,
|
|
20
21
|
...props3
|
|
21
22
|
} = props instanceof Object ? props : {};
|
|
22
23
|
|
|
@@ -102,10 +103,12 @@ function useAsyncFetch(props, props2) {
|
|
|
102
103
|
}, poll);
|
|
103
104
|
|
|
104
105
|
useEffect(() => {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
if (!ignoreCleanup) {
|
|
107
|
+
return () => {
|
|
108
|
+
setUnmounted(true);
|
|
109
|
+
cancelActiveRequest();
|
|
110
|
+
};
|
|
111
|
+
}
|
|
109
112
|
}, []);
|
|
110
113
|
|
|
111
114
|
return {
|