Florian
12/02/2020, 9:32 AMA
with 2 subclasses B
and C
. Can I combine a Flow<B>
and a Flow<C>
to a Flow<A>
?magnumrocha
12/02/2020, 9:33 AMcombine(flowA, flowB) { some logic here }
louiscad
12/02/2020, 9:35 AMFlorian
12/02/2020, 9:36 AMcombine
but I don't see how I can return a Flow of the superclassmagnumrocha
12/02/2020, 9:36 AMcombine<A>(flowB, flowC)
Florian
12/02/2020, 9:37 AMlouiscad
12/02/2020, 9:37 AMFlorian
12/02/2020, 9:37 AMPair
from combine
louiscad
12/02/2020, 9:38 AMFlorian
12/02/2020, 9:39 AMlouiscad
12/02/2020, 9:39 AMcombine
was more natural to think ofFlorian
12/02/2020, 9:40 AMlouiscad
12/02/2020, 9:41 AMFlorian
12/02/2020, 9:41 AMlouiscad
12/02/2020, 9:41 AMcombine
? I'm aksing to understand your thought process, and see if the doc should mention the merge
operator to help folks in the future.Florian
12/02/2020, 9:44 AMmagnumrocha
12/02/2020, 9:51 AMFlorian
12/02/2020, 9:54 AMmagnumrocha
12/02/2020, 9:55 AMFlorian
12/02/2020, 9:56 AMcombine
was actually the correct operator, because with merge
I don't get all the values into a single Flowval combinedChatFlow: Flow<List<Chat>> = combine(directChatsFlow, groupChatsFlow) { directChats, groupChats ->
directChats + groupChats
}
magnumrocha
12/02/2020, 2:52 PM