Alex Anisimov
02/15/2021, 9:33 AMBenoƮt
02/15/2021, 11:13 AMDaniele B
02/15/2021, 11:58 AMBenoƮt
02/15/2021, 12:53 PMDaniele B
02/15/2021, 12:57 PMBenoƮt
02/15/2021, 1:06 PMfun StateManager.setLoading() {
state = state.copy(isLoading = true)
}
suspend fun StateManager.setCityData(city: String) {
val detailData = dataRepository.fetchCityData(name)
state = state.copy(detail = detailData, isLoading = false)
}
Instead, I use "business logic" functions that look like this. The NetworkCall functions are provided by repositories, they take care of cachingMichal Klimczak
02/15/2021, 1:19 PMDaniele B
02/15/2021, 1:38 PMBenoƮt
02/15/2021, 1:47 PMDaniele B
02/15/2021, 1:51 PMBenoƮt
02/15/2021, 2:03 PMBenoƮt
02/15/2021, 2:05 PMFrancis Mariano
02/15/2021, 2:06 PMDaniele B
02/15/2021, 2:06 PMBenoƮt
02/15/2021, 2:08 PMDaniele B
02/15/2021, 2:10 PMBenoƮt
02/15/2021, 2:13 PMDaniele B
02/15/2021, 2:13 PMFrancis Mariano
02/15/2021, 2:15 PMBenoƮt
02/15/2021, 2:18 PMDaniele B
02/15/2021, 2:29 PMBenoƮt
02/15/2021, 2:35 PM