vapoyan
suspend
Double
calculateResult()
resultDoSomething1
resultDoSomething2
val resultDoSomething1: Double = 0.0 val resultDoSomething2: Double = 0.0 fun doSowmthing1() { iewModelScope.launch { resultDoSomething1 = downloadDataFromServer1() } } fun doSowmthing2(){ iewModelScope.launch { resultDoSomething2 = downloadDataFromServer2() } } fun calculateResult() { val res = resultDoSomething1 + resultDoSomething2 }
Nikhil
https://www.youtube.com/watch?v=6v8iJDJdtMc▾
Ernestas
A modern programming language that makes developers happier.