Today I learned
August 06, 2020
No floating promises
Unhandled Promises can cause unexpected behavior. For example they can resolve when you don't expext it.
So the best way to deal with Promises is to return them from functions that start them and then handle them.
To enforce this behaviour and prevent unhandled promises, you can use this tslint rule: no-floating-promises
I find it really helpful and it can reveal a lot of bad code and potential non-determistic behaviour.
Greetings MarcoGo back to other today-I-learned posts