import { KeyedCache } from 'utils' const caches = new Set() export function clearAllCaches() { caches.forEach(x => { x.clear() }) } export function createDeferredCache(fn: (id: string, ...rest: U) => Promise) { const run = KeyedCache(fn) caches.add(run.cache) return run }