
As you can see the ViewModel has no idea to whom might subscribe to the emitted data. It is also completely abstracted from the data sources, it simply asks theBusRepository for the data and doesn’t really care of it’s internal implementations, it could come from a remote webservice or a simple local database (this is oddly satisfying to know we’re respecting the Single responsibility principle).
nous s…roblem. If you are not familiar with reactive programming you can read this introduction. In short, RxJava allows you to manage data via asynchronous streams and gives you many operators that you can apply to the stream in order to transform, filter or combine the data.