RxJava operator that emits if different from last

后端 未结 1 352
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-18 08:19

Is there an operator that emits items if the item to be emitted is not equal the last emitted item?

1条回答
  •  一生所求
    2021-01-18 09:14

    There is distinctUntilChanged().

    RxJava also implements the distinctUntilChanged operator. It only compares emitted items from the source Observable against their immediate predecessors in order to determine whether or not they are distinct.

    0 讨论(0)
提交回复
热议问题