const inflightRequests = new Map();
export function dedupeInflight(key, task) {
    const existing = inflightRequests.get(key);
    if (existing) {
        return existing;
    }
    const promise = task().finally(() => {
        inflightRequests.delete(key);
    });
    inflightRequests.set(key, promise);
    return promise;
}
//# sourceMappingURL=dedupeInflight.js.map