I guess more of a design pattern problem. If I have a view model on Android that has 3 flows that it needs to collect from when the view opens, but the flows may need to be restarted based on an event, what is the standard safe way to do this?
g
gildor
06/08/2021, 7:01 AM
needs to be restarted? Looks as a case for flatMapLatest
But maybe you have an example of what you trying to achieve
š 1
u
ursus
06/08/2021, 12:05 PM
have a trigger MutableSharedFlow and use flatMapLatest .. each emit into the trigger will resubscribe the body of the flatmap, restarting it if it is cold
š 1
šÆ 1
j
james
06/09/2021, 1:34 AM
Thanks guys, definitely overthought it. flatMapLatest and your suggestion makes sense!