These are chat archives for ReactiveX/RxJava

24th
Mar 2018
Prashant Singhal
@PrashantSinghal
Mar 24 2018 09:59

In this file SampleMVI_ViewModel , I'm trying to decode this piece of code...

    private val intentFilter: ObservableTransformer<BrowseIntent, BrowseIntent> =
            ObservableTransformer<BrowseIntent, BrowseIntent> {
                it.publish {
                    Observable.merge(it.ofType(BrowseIntent.InitialIntent::class.java).take(1),
                            it.filter({ intent -> intent !is BrowseIntent.InitialIntent }))
                }
            }

Is my understanding correct that this transformer is basically trying to ensure that the InitialIntent is published only once (whenever it occurs). Post that, it will never be published ever again?

David Karnok
@akarnokd
Mar 24 2018 11:06
@PrashantSinghal Looks like so; it will make sure at most one InitialIntent value is passed along.
Prashant Singhal
@PrashantSinghal
Mar 24 2018 11:16
Thanks @akarnokd .