Files
voyage/apps/public-web/node_modules/next/dist/esm/lib/with-promise-cache.js
PascalSchattenburg d147843c76 feat(blog): add file-based blog with dynamic slugs, MDX content and layout shell
- Introduced blog routing using Next.js App Router
- Implemented dynamic [slug] pages for blog posts
- Added MDX-based content loading via lib/posts
- Integrated shared TopBar layout with navigation
- Established clear content, lib and component separation
2026-01-22 14:14:15 +01:00

14 lines
380 B
JavaScript

export function withPromiseCache(cache, fn, getKey) {
return (...values)=>{
const key = getKey ? getKey(...values) : values[0];
let p = cache.get(key);
if (!p) {
p = fn(...values);
p.catch(()=>cache.remove(key));
cache.set(key, p);
}
return p;
};
}
//# sourceMappingURL=with-promise-cache.js.map