We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eeb39a4 commit 2d07a6eCopy full SHA for 2d07a6e
packages/gitbook-v2/src/lib/data/memoize.ts
@@ -10,6 +10,10 @@ import pMemoize, { type CacheStorage } from 'p-memoize';
10
* Hopefully one day this can be done directly by 'use cache'.
11
*/
12
export function memoize<F extends (...args: any[]) => any>(f: F): F {
13
+ if (process.env.NODE_ENV === 'production') {
14
+ return f;
15
+ }
16
+
17
const getFunctionCache = async () => {
18
const functionsCache = await getRequestCacheWeakMap();
19
const cache = functionsCache.get(f);
0 commit comments