Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 1.11 KB

README.md

File metadata and controls

20 lines (15 loc) · 1.11 KB

codebeat badge Maintainability

Using Promises in JS - sample code

This code was written for the: Breaking and taming the Promise chain in JS article posted on the RockedScience Medium publication.

Starting from the worst case scenario shown in ugly-version.js, the code is converted to use Promise.all() returning all values at the end of the execution (promise-all-version.js) and invidually at each invocation (promise-all-improved-version.js).

The last example in tidy-version.js shows my favourite implementation of a chain of Promises.

Please read the full article linked above for details.