← Back to miito.dev

Digital Garden

October 21
Garden HubAutomotiveTypeScriptTestingSVGSQLSecurityReactPerformanceNode.jsModdingJavaScriptGame DevDevOpsDesignCSSCommunication
miito.dev
© Brian Dinh (miito.dev)
✕
✕
§ GARDEN · JAVASCRIPT · CLASS OPEN
NODE FILE · ENTRY

Promises, Async/Await, and Error Boundaries

FILED UNDER · JAVASCRIPT
①Read
②Meta

The evolution of async JavaScript — from callback hell to structured concurrency with Promise.allSettled.

JavaScript's async story has three chapters. Callbacks gave us non-blocking I/O but produced deeply nested, hard-to-reason-about code. Promises flattened the nesting with .then() chains. Async/await gave us synchronous-looking code that's actually asynchronous. Each layer is sugar over the one below.

Beyond Promise.all

Promise.all rejects on the first failure — which means you lose the results of successful promises. Promise.allSettled waits for everything and reports each result individually. Promise.any resolves with the first success. Pick the combinator that matches your error-handling strategy.

DTNRWORKSHOP ARMAMENTSSN 2012.OTT.0176