We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a76c93 commit 55432bfCopy full SHA for 55432bf
src/lib/utils/data/dataLoader.ts
@@ -28,16 +28,14 @@ export function dataLoader<T extends unknown[]>(
28
},
29
cacheTimeout?: number
30
): () => Promise<T> {
31
+ if (USE_MOCK_DATA) console.warn("Using mock data")
32
const cachedLoaders = loaders.map(([key, loader]) => {
33
const cachedLoader = cacheAsyncFn(key, loader, {
34
cacheTimeout,
35
})
36
return async () => {
37
try {
- if (USE_MOCK_DATA) {
38
- console.log("Using mock data for", key)
39
- return await loadMockData(key)
40
- }
+ if (USE_MOCK_DATA) return await loadMockData(key)
41
42
return await cachedLoader()
43
} catch (error) {
0 commit comments