First of all, thank you very much for the article and the details provided in there, especially the last two section gave me a new point of view on promises and async/await.
I like to use then chaining (not nesting) for Promises a lot (same as for Observables and map) and have so far not considered the memory and performance impacts while doing so.
I like the chaining approach as, with the functions named appropriately, it reads like text. It is certainly possible to achieve something similar in a single then block calling properly named functions but, at least to me, it does not read as "fluently" as chaining (this is of course opinionated).
I also do not want to fall in the "premature optimization" trap so one/I may need to find (as always) a balance between readability, writability and performance...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
First of all, thank you very much for the article and the details provided in there, especially the last two section gave me a new point of view on promises and
async/await
.I like to use
then
chaining (not nesting) for Promises a lot (same as for Observables andmap
) and have so far not considered the memory and performance impacts while doing so.I like the chaining approach as, with the functions named appropriately, it reads like text. It is certainly possible to achieve something similar in a single
then
block calling properly named functions but, at least to me, it does not read as "fluently" as chaining (this is of course opinionated).I also do not want to fall in the "premature optimization" trap so one/I may need to find (as always) a balance between readability, writability and performance...