I have the following test, which fails. It seems l...
# coroutines
j
I have the following test, which fails. It seems like the update done by one flow does not affect the other one. Is this a case where I should use a
Channel
to be able to communicate data between coroutines?
r
Umm I would just write 2 tests. One test testing the first flow transmission and the 2nd one testing the second flow transmission. And just turn the flow into a list and check the first 2 elements..
n
You can use a single
MutableStateFlow
and
launch
two coroutines writing into it. Values can be updated with
flow.update { ... }
so you get the old state and can copy it.