How you can use both RxJS Observables and async/await Promises to create resilient & clean applications. This article follows on from my previous articles startWith and flatMap vs switchMap. I like writing about RxJS. Even though I’ve spent so much time with it lately with my active projects, I still find new and exciting features that improve my development workflow.
This article follows on from my previous articles _[**_startWith](https://levelup.gitconnected.com/rxjs-operator-tips-startwith-d67109c8883e)_ and _[flatMap vs switchMap](https://medium.com/swlh/cant-tell-your-flatmaps-from-your-switchmaps-a1f0f497b61a).**
I like writing about RxJS. Even though I’ve spent so much time with it lately with my active projects, I still find new and exciting features that improve my development workflow.
from() Observable to wrap your promises and then you can use them in an RxJS pipeline.
Read on if you’d like to know the details.
Before we dive in deep, some quick concepts. The core principles of Reactive Programming involve subscribing to a stream of data.
Before Reactive Programming, you would request the data you needed (perhaps a stock price) and then on a timer perhaps ask for it again.
However, now, you can “subscribe” to a stream which will emit when new data is available. Much easier.
Libraries like RxJS allow the easy creation and subscription of data streams. In addition, Operators will alter the stream in different ways to create a data pipeline.
Examples of Operators could be:
Operators and Observables are tied together in some really interesting ways. A simple example could be:
Fetch me the latest stock ticker symbols, updating no more than once per minute
This would be achieved by:
IntervalObservable that emits every 60 seconds
Learn what RxJS is and why it is so powerful with hands on examples