We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4684f87 commit 769372aCopy full SHA for 769372a
src/factory.js
@@ -36,6 +36,9 @@ export default function factory(localforage) {
36
37
async function get(bin, key, validate = true) {
38
const isValid = validate && cacheBins[bin] ? await cacheBins[EXPIRE_BIN].getItem(getExpireKey(bin, key)) > Date.now() : true;
39
+ if (!isValid) {
40
+ await cacheBins[EXPIRE_BIN].removeItem(getExpireKey(bin, key));
41
+ }
42
return isValid ? await cacheBins[bin].getItem(key) : null; // localForage return null if item doesn't exist
43
}
44
0 commit comments