When I collect a message, I do a test and for some value , I would like to leave the collect function and return a value. I'm not sure how to do that. Any idea?
w
wasyl
02/05/2021, 8:00 PM
Do you only care about that specific value? You can do
flow.first { condition }
for example
g
Gilles Barbier
02/05/2021, 8:01 PM
Oh! I did not know. Let me try that
Gilles Barbier
02/05/2021, 8:06 PM
It works, I'm a bit ashamed by such a simple solution... thank you !