Created
September 19, 2021 17:06
-
-
Save fabioCollini/79e707baa7041105e34a1d77196ad264 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CalculatorState { | |
var v1 by mutableStateOf("0") | |
var v2 by mutableStateOf("0") | |
val result = snapshotFlow { v1 to v2 }.mapLatest { | |
sum(it.first, it.second) //sum is a suspend method here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment