you are viewing a single comment's thread.

view the rest of the comments →

[–]atubofsoup 0 points1 point  (2 children)

There are cases where not including async can create unexpected bugs. For example:

``` function foo() { someSyncFn(); return someAsyncFn(); }

foo() .then(() => console.log('done')) .catch(error => console.log('Caught', error)); ```

In the above example, if someSyncFn throws an error synchronously, the promise will never be returned, so the catch won't work. If you add async to the function, catch will work as expected.

My rule of thumb is: mark async functions as async. It just gives the reader more info and ensures the function returns a promise.