Closed namig-tahmazli closed 1 year ago
I wrote a test for this and it passes, so I suspect it's something to do with some wiring code not included here. Ex: the job is being canceled or your presenter instance is changing and the UI code is not handling that correctly. If you have a standalone reproducible sample then I can take another look.
@Test
fun test() = runTest {
val job = Job()
val clock = BroadcastFrameClock()
val scope = CoroutineScope(coroutineContext + job + clock)
var text by mutableStateOf("")
val flow = scope.launchMolecule(ContextClock) {
text
}
assertEquals("", flow.value)
text = "hey"
runCurrent()
clock.sendFrame(0)
assertEquals("hey", flow.value)
job.cancel()
}
It's probably #63 where the issue is more the interaction with Compose UI and not Molecule itself.
Hi I have a simple setup like this
But it does not work properly. The TextField value never updated.