If I have 3 MutableStateFlows that I would like to keep but also being able to set the value from one other Flow, is there a way to create that new flow that doesn’t force me to collect and resend the data “manually” (i.e I want to do this in a more flowy way)
this is the current solution, but I would like to get rid of the “launch” part (if possible) the setter does not have to keep the state, so that one can be what ever necessary to spread the value
val outFlows = listOf(
MutableStateFlow(true),
MutableStateFlow(true),
MutableStateFlow(true)
)
val setter = MutableStateFlow(true)
...
launch {
setter.collect {value -> outFlows.forEach { it.emit(value) } }
}