but for when the flows (arguments) are calculated based on the item in the main flow? My use case is a flow of
Item
s where each
Item
has a number of properties whose values are provided by flows. Initially those properties are null and so the operator I’m trying to implement, would transform an
Item
such that the properties are populated and the resulting Flow will emit a new
Item
each time any of the properties updates (as well as when the original flow emits a new
A map is one-to-one, so I don’t see how that can help. My current hack creates the ‘property’ flows in
onEach
and then combines those.
t
Trym Nilsen
08/31/2022, 11:41 AM
Do you want to end up with multiple flows from a single flow?
m
Mark
08/31/2022, 11:43 AM
Ideally, a single result flow from a single source flow, but with multiple property flows injecting values. The resulting flow would be potentially emitting far more items than the source flow. The items (of the resulting flow) are emitted whenever any of the ‘property’ flows emit. However, when the source ‘item’ flow emits, the old ‘property’ flows are discarded and new ones created.
r
Robert Williams
08/31/2022, 12:01 PM
Sounds like you want a
flatMapLatest
on the outer flow returning a zip/combine on the inner flows?
m
Mark
08/31/2022, 12:52 PM
@Robert Williams I think you’re right, thanks! I’ll give it a shot