Open viratshukla opened 5 years ago
@viratshukla I would like to work on this! ✋
@nikhilbansal97 Good, then you can create a PR. Also include Room DB to cache the response. Current Code is not storing json response.
The current "use-case" setup and repository of Singles (uh, I mean "coroutines that return eithers") is not actually suitable for proper offline-first app. You'll run into trouble when you start saving things to disk, because you'll need to observe disk instead of hacking the responses back to your ui per each single.
Hey @viratshukla I am unable to work on this one due the problem stated by @Zhuinden If you'd like to assign this issue to someone else, you can.
@Zhuinden you were right. The current architecture does not seem to be suitable for an offline-first app.
Currently the app is dependent on the network source for the data, but when implementing paging with database, the source of data will become the database which will propagate changes via LiveData and hence, it will break the UseCase class implementation. We could set the data source as the retrofit call, but the API is not paginated.
Please implement Paging library Using latest Jetpack