diff --git a/src/index.test.ts b/src/index.test.ts index e95f3e9..a93fe3f 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -230,7 +230,7 @@ describe('Higher-Order Function', () => { return 'custom-key'; }, events: { - onCacheSet: ({key}) => { + onCacheSet: ({ key }) => { expect(key).toBe('custom-key'); } } diff --git a/src/lib.ts b/src/lib.ts index bf6e030..55087d8 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -111,7 +111,9 @@ export function cacheCandidate Promise>( return function cacheCandidateWrapper(...args: Parameters): ReturnType { return letsCandidate({ options, - key: _options.customKeyFunction ? _options.customKeyFunction(args) : getDataCacheKey([uniqueIdentifier, JSON.stringify(args)]), + key: _options.customKeyFunction + ? _options.customKeyFunction(args) + : getDataCacheKey([uniqueIdentifier, JSON.stringify(args)]), timeoutCache, runningQueryCache, timeframeCache,