dedup-async
Deduplicate concurrent promise calls by resolving them together.
dedup-async wraps any function that returns promise. Succeeding call to the same function will get a promise that resolves/rejects along with the previous pending promise if any, but not triggering the actual logic.
const dedupa = let evillet n = 0 { return { if evil throw 'Duplicated concurrent call!' evil = true }} { } //Prints 'Working...', resolves 0 //No print, resolves 0 //Prints 'Working...', resolves 1