与上次不同时发出的 RxJava 运算符 [英] RxJava operator that emits if different from last

查看:34
本文介绍了与上次不同时发出的 RxJava 运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果要发射的项目不等于最后发射的项目,是否有一个运算符会发射项目?

解决方案

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

解决方案

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.

这篇关于与上次不同时发出的 RxJava 运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆