John O'Reilly
09/29/2020, 7:12 PMcollects
values from some flow
source (e.g. db)John O'Reilly
09/29/2020, 7:13 PMGlobalScope
like this 🙂 )
fun fetchPeople(success: (List<Assignment>) -> Unit) {
GlobalScope.launch(Dispatchers.Main) {
fetchPeopleAsFlow()?.collect {
success(it)
}
}
}
John O'Reilly
09/29/2020, 7:15 PMflow
?ankushg
09/29/2020, 7:36 PMJohn O'Reilly
09/29/2020, 7:39 PMankushg
09/29/2020, 7:40 PM