Coroutine Builders: Using coroutineScope
Learn to use coroutineScope and get a summary of coroutine builders.
We'll cover the following
Imagine that in some repository function, we need to asynchronously load two resources—for example, user data and a list of articles. In this case, we want to return only those articles that the user should see. To call async
, we need a scope, but we don’t want to pass it to a function. To create a scope out of a suspending function, we use the coroutineScope
function.
Get hands-on with 1200+ tech skills courses.