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
When you have lodash in your application anyway, you can simply utilize lodash's isEqual()
function, which does a deep comparison and perfectly matches the signature of distinctUntilChanged()
:
.distinctUntilChanged(isEqual),
Or if you have _
available (which is not recommended anymore these days):
.distinctUntilChanged(_.isEqual),