Update src/utils/createMemoryCache.js

Co-authored-by: Ajay Ramachandran <dev@ajay.app>
This commit is contained in:
Nanobyte 2020-10-09 08:58:15 +02:00 committed by GitHub
parent 25b91af8bc
commit fb7ff50feb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,8 +1,8 @@
module.exports = function createMemoryCache(memoryFn, cacheTimeMs) {
// holds the promise results
const cache = new Map;
const cache = new Map();
// holds the promises that are not fulfilled
const promiseMemory = new Map;
const promiseMemory = new Map();
return function (...args) {
// create cacheKey by joining arguments as string
const cacheKey = args.join('.');