https://kotlinlang.org logo
#codereview
Title
# codereview
m

Medamine Rihane

02/07/2020, 12:59 PM
@Kashif i think its better to always get data from local and update local data every time you have changes so you have a single source of data/truth
k

Kashif

02/07/2020, 1:44 PM
yes above code is doing the same, it first get data from server and if sever returns data then save it local datasource and return that data to UseCase. But consider a situation where app first ask data from server but network is null then how app pass this exception to UseCase class? for that what i did is i pass that SocketException to Local datasource so if LocalDataSource also don’t have data then throw SocketException back to UseCase