re: An async/await gotcha VIEW POST


I'm sorry but you not moving from promises, your still using promises?


We are rewriting as we go. We have about 350,000 lines of code, so it's a process 😃


But why? Sorry I don't mean to be the negative rubber duck. Async Await (good idea for greenfield projects) but this is syntactic suger that makes little difference because under the hood it's still a promise.

We're not actively going through the codebase and replacing things, but we are able to eliminate a lot of extra scoping and syntax by using async/await as we make changes or add new features.

For example if you want to use the result of a promise several .then calls later, you have to either nest your promises or use a scope variable. With async/await you don't, so it has a nicer tidiness factor.

Agreed promises if used in a certain way, can cause a form of callback hell. How many promises are there in your codebase. 35000 lines doesn't really explain the size of it. To clarify I have been using async await way back when they dropped in typescript last year. I love them.

How many promises are there in your codebase

Lots of them, maybe 5-10k?

Jeez well if it make your codebase cleaner, I can see why now. Thanks for sharing the post 😀.

code of conduct - report abuse