Issues of callbacks | promise/thenable | Async/Await | Rx/Combine | Note |
|---|---|---|---|---|
multiple subscribers | In the callback world this is usually done with listener/delegate pattern. Can also do with callbacks with a complex setup. | |||
chaining without nesting | ||||
handling errors at the end | Nice thing about javascript promise (& async/await which is based on promise) is that catch handles both thrown errors and promise errors | |||
taking input from multiple async sources | ||||
sources firing multiple times | 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. | |||
Simple APIs | ||||
Very Simple APIs | ||||
calling multiple times with a dynamic list in serial without recursion | With Rx it's doable but less readable. |