https://kotlinlang.org logo
#coroutines
Title
# coroutines
s

Suser

11/06/2023, 4:05 PM
I have a viewmodel that exposes a flow of events, sometime during that viewmodels lifecycle i can get a callback from a service with a flow that i want to output to that initial flow, is there a way to do that without subscribing to the service flow inside the viewmodel and just outputting manually to the external flow? i just want to pipe one flow to another when i receive it.
c

Chris Fillmore

11/07/2023, 12:54 AM
Depending on your use case exactly, you could look at
flatMapLatest
or
emitAll