I have stream of objects and I need to compare if current object is not same as previous and in this case emit new value. I found distinctUntilChanged operator should do exa
If you change the value mutably, none of the other answers work. If you need to work with mutable data structures, you can use distinctUntilChangedImmutable, which deep copies the previous value and if no comparison function is passed in, will assert that the previous and the current values deep equals each other (not === assertion).