Description
Store the data retrieved from the web into Observables. Also check whether the data received from the web, is equal as the specified model or create a new model with the received data. This results into less unexpected code. Also creating tests checking whether the received data matches the model, allows programmers to see if the model from the web has changed.
Example
We created a simple MVVM example.
The data we receive from the NoteDao, is how our ViewModel wants it, which is LiveData
So in this case there is not soo much changing to be done. Our NoteRepository contains all the notes. If however we receive data from a webservice, we need to make sure our data is valid.
Check this page to view the complete repository.