Fudge
07/26/2020, 4:33 PM@Composable suspend fun askQuestion() : Answer {
return suspendCoroutine { continuation ->
QuestionComponent(onAnswer = {answer -> continuation.resume(answer)})
}
}
The problem is that if I do something like this
setContent {
runBlocking { askQuestion() }
}
It won't compile because "@Composable invocations can only happen from the context of a @Composable function"Adam Powell
07/26/2020, 4:34 PMFudge
07/26/2020, 4:36 PMAdam Powell
07/26/2020, 4:36 PMSnackMenu
class - that's the hoisted state object bridging suspending request-response API with compose-aware stateFudge
07/26/2020, 4:42 PMAdam Powell
07/26/2020, 4:44 PMFudge
07/26/2020, 4:46 PMprivate constructor
do exactly that?class Snack private constructor(...)
Adam Powell
07/26/2020, 4:47 PMSnack
class or its companion object could call itLeland Richardson [G]
07/26/2020, 7:10 PM