klayground icon indicating copy to clipboard operation
klayground copied to clipboard

Question about the flatMapMerge() operator

Open aliumujib opened this issue 4 years ago • 0 comments

Hello Garima,

Your repo is a great example of using Kotlin Flows with the MVI architecture, so thanks for it 😃. I have a quick question though. In processActions () method of your CharactersViewModel . You demonstrated two approaches of mapping from actions to results. When using the streaming approach in actionToResultTransformer(), I noticed that my actionsFlow suddenly returns emits more than one action which in turn executes more than one network call. So flowOf("A") emits "A", "A" or sometimes "A","A","A" when I pass it into actionToResultTransformer() but behaves normally when I use the non streaming approach. Is there a reason for this behaviour and how can it be fixed?

aliumujib avatar Mar 08 '20 06:03 aliumujib