Skip to content

Commit 1cc07c5

Browse files
committed
fix: cache still expires by default
use serialize-friendly Number.MAX_SAFE_INTEGER instead of Infinity
1 parent 769372a commit 1cc07c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function factory(localforage) {
4242
return isValid ? await cacheBins[bin].getItem(key) : null; // localForage return null if item doesn't exist
4343
}
4444

45-
async function set(bin, key, data, expire = Infinity) {
45+
async function set(bin, key, data, expire = Number.MAX_SAFE_INTEGER) {
4646
return await Promise.all([
4747
cacheBins[EXPIRE_BIN].setItem(getExpireKey(bin, key), Date.now() + Number(expire)),
4848
cacheBins[bin].setItem(key, data)

0 commit comments

Comments
 (0)