Update src/utils/createMemoryCache.js

Co-authored-by: Ajay Ramachandran <dev@ajay.app>
This commit is contained in:
Nanobyte
2020-10-09 08:58:31 +02:00
committed by GitHub
parent fb7ff50feb
commit 41dc16453e

View File

@@ -3,7 +3,7 @@ module.exports = function createMemoryCache(memoryFn, cacheTimeMs) {
const cache = new Map();
// holds the promises that are not fulfilled
const promiseMemory = new Map();
return function (...args) {
return (...args) => {
// create cacheKey by joining arguments as string
const cacheKey = args.join('.');
// check if promising is already running