Skip to content

Commit 55432bf

Browse files
pettinaripwackerow
andauthored
Apply suggestions from code review
Co-authored-by: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
1 parent 2a76c93 commit 55432bf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/lib/utils/data/dataLoader.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,14 @@ export function dataLoader<T extends unknown[]>(
2828
},
2929
cacheTimeout?: number
3030
): () => Promise<T> {
31+
if (USE_MOCK_DATA) console.warn("Using mock data")
3132
const cachedLoaders = loaders.map(([key, loader]) => {
3233
const cachedLoader = cacheAsyncFn(key, loader, {
3334
cacheTimeout,
3435
})
3536
return async () => {
3637
try {
37-
if (USE_MOCK_DATA) {
38-
console.log("Using mock data for", key)
39-
return await loadMockData(key)
40-
}
38+
if (USE_MOCK_DATA) return await loadMockData(key)
4139

4240
return await cachedLoader()
4341
} catch (error) {

0 commit comments

Comments
 (0)