diff --git a/JavaScript/6-promise.js b/JavaScript/6-promise.js index 07162c5..96e2780 100644 --- a/JavaScript/6-promise.js +++ b/JavaScript/6-promise.js @@ -34,7 +34,6 @@ class Queue { (err) => void this.finish(err) ) .finally(() => { - this.count--; if (this.waiting.length > 0) this.next(); }); } @@ -45,6 +44,7 @@ class Queue { if (err && onFailure) onFailure(err, res); else if (onSuccess) onSuccess(res); if (onDone) onDone(err, res); + this.count--; if (this.count === 0 && this.waiting.length === 0 && onDrain) onDrain(); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy