BMG
05/02/2020, 3:23 PMisFetching
is a class variable which holds network data fetching state.
Is this a good pattern? I was trying to remove this class variable to reduce state in presenter. Is that possible or will it be an overkill?
override fun fetchData() : {
if(isFetching) return
isFetching = true
apiService
.fetchData()
.doOnFinally { isFetching = false }
.subscribe({
view?.updateData()
}, { })
}
KayCee
05/04/2020, 4:22 AMBMG
05/04/2020, 7:16 AMview
is an interface implemented by Activity/fragment.KayCee
05/04/2020, 7:50 AMapiService
? The main thing is you do the fetching job in presenter, why?BMG
05/04/2020, 9:26 AM