Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Loading Spinner
viewModelScope.launch {
getAllTodosUseCase(force)
.onStart { _refreshing.value = true }
.onCompletion { _refreshing.value = false }
.collect { response ->
(response as? Result.Success)?.let { _todos.value = it.result }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment