Hey I want to use async call, I have some doubt in...
# coroutines
v
Hey I want to use async call, I have some doubt in async call
Copy code
suspend fun fetchTwoDocs() =
    coroutineScope {
        val deferredOne = async { fetchDoc(1) }
        val deferredTwo = async { fetchDoc(2) }
        deferredOne.await()
        deferredTwo.await()
    }
and what the difference of
Copy code
viewModelScope.launch { }
or
Copy code
coroutineScope { }
l
One will suspend, just look at the function signatures, and their KDoc
v
can you give me link?
l
You don't need, it's all right in your IDE
v
ok
l
Hover the function calls, or ctrl/cmd click them
v
okk i'll try that