Comparing version 3.0.6 to 3.0.7
@@ -10,5 +10,10 @@ var cachePromise = new Map(); | ||
// Because the promise.finally will change the reference of the promise | ||
cachePromise.set(cacheKey, promise); | ||
promise["finally"](function () { | ||
cachePromise.set(cacheKey, promise); // no use promise.finally for compatibility | ||
promise.then(function (res) { | ||
cachePromise["delete"](cacheKey); | ||
return res; | ||
})["catch"](function (err) { | ||
cachePromise["delete"](cacheKey); | ||
throw err; | ||
}); | ||
@@ -15,0 +20,0 @@ }; |
@@ -18,5 +18,10 @@ "use strict"; | ||
// Because the promise.finally will change the reference of the promise | ||
cachePromise.set(cacheKey, promise); | ||
promise["finally"](function () { | ||
cachePromise.set(cacheKey, promise); // no use promise.finally for compatibility | ||
promise.then(function (res) { | ||
cachePromise["delete"](cacheKey); | ||
return res; | ||
})["catch"](function (err) { | ||
cachePromise["delete"](cacheKey); | ||
throw err; | ||
}); | ||
@@ -23,0 +28,0 @@ }; |
{ | ||
"name": "ahooks", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "react hooks library", | ||
@@ -61,3 +61,3 @@ "keywords": [ | ||
"license": "MIT", | ||
"gitHead": "f985ed77755a57939706b08b1bbb1806acb24c59" | ||
"gitHead": "eeffc29756a2126b25247a211db44e54966613b6" | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
620276
15421