RxJS distinctUntilChanged - object comparsion

后端 未结 7 823
青春惊慌失措
青春惊慌失措 2021-01-03 20:57

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

7条回答
  •  时光取名叫无心
    2021-01-03 21:46

    I finally figure out where problem is. Problem was in version of RxJS, in V4 and earlier is different parameters order than V5.

    RxJS 4:

    distinctUntilChanged = function (keyFn, comparer)

    RxJS 5:

    distinctUntilChanged = function (comparer, keyFn)

    In every docs today, you can find V4 parameters order, beware of that!

提交回复
热议问题