Now there are two sources from where the data is coming:
- The periodic updates from Yahoo Financial Stocks
- The constant stream of Twitter status updates
It is necessary to merge them into a single Observable so that we can make use of a single combined flow and reuse the code we already have to display them.
To merge two Observables, we will use the Observable.merge() function:
Observable.merge( observable1, observable2)
This Observable will return items of the StockUpdate type, so it means that the observable1 and observable2 will have to return the StockUpdate type as well.
In the place of observable1, we can move the code that is responsible for the periodic updates of financial stock ...