Different async mechanisms
Default view
Issues of callbacks
promise/thenable
Async/Await
Rx/Combine
Note
promise/thenable
Async/Await
Rx/Combine
In the callback world this is usually done with listener/delegate pattern. Can also do with callbacks with a complex setup.
promise/thenable
Async/Await
Rx/Combine
Nice thing about javascript promise (& async/await which is based on promise) is that catch handles both thrown errors and promise errors
promise/thenable
Async/Await
Rx/Combine
Rx/Combine also allows advanced operations on sources that fire multiple times, e.g. throttle, debounce.
Promise: second resolve call in a promise is discarded.
Promise: second resolve call in a promise is discarded.
promise/thenable
Async/Await
Rx/Combine
With Rx it's doable but less readable.
Next: Promise basics