DEV Community

Discussion on: Converting to Asynchronous Code Using IIFEs

Collapse
 
thomasstep profile image
Thomas Step

You are correct that Promise.all is the main driver in reducing time. I'm simply trying to illustrate how you could use IIFEs together with Promise.all. Another perfectly valid way to speed up execution would be to create normal async functions and use the returned Promises from those functions in Promise.all. This method just short cuts that and allows you to execute the code using an IIFE while still awaiting it.

Simply an alternative to traditional refactoring using functions. Also I don't see much about IIFEs and wanted to write about them. I'm sorry if the title was misleading.