I think the async/await is a clear winner here, since these were 4 sequential operations, 2 of which just needed to yield yet still block the progress of this function, and cancel the function if they throw.
It's the textbook happy case for async/await.
I do agree with @avalander
's refactor though, which gets you closer to this without the async syntax.
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.
I think the async/await is a clear winner here, since these were 4 sequential operations, 2 of which just needed to yield yet still block the progress of this function, and cancel the function if they throw.
It's the textbook happy case for async/await.
I do agree with @avalander 's refactor though, which gets you closer to this without the async syntax.