Chris
06/07/2019, 8:56 AMfun fetchData() {
isLoading.value = true
this.launch(context = coroutineContext) {
useCase.execute {
onComplete { it ->
// do some stuff with it
isLoading.value = false
}
onError {
isLoading.value = false
}
onCancel {
isLoading.value = false
}
}
}
}