操作符 按字母排序讲解:
1、Amb
链接:http://reactivex.io/documentation/operators/amb.html
概要说明:
多个被观察者开始执行,谁先开始,整个流水操作就用谁的。
- Javadoc:
amb(Iterable)
- Javadoc:
ambArray(Iterable)
- Javadoc:
ambWith(Observable)
2、CombineLatest
链接:http://reactivex.io/documentation/operators/combinelatest.html
概要说明:
CombineLatest:两条线,谁到达就跟另外一条线最新的组合
WithLatestFrom:以第一条流水线为准则,第一条的流水到了,就跟第二条的匹配,如果第二条的数据还没用,则放弃组合;
3、Concat
链接:http://reactivex.io/documentation/operators/concat.html
概要说明:
按订阅顺序,两个或多个发射而不交叉,排队发射。
4、Create
链接:http://reactivex.io/documentation/operators/create.html
概要说明:
创建一个ObservableOnSubscribe可发射源。
5、Defer
链接:http://reactivex.io/documentation/operators/defer.html
概要说明:
subscribe订阅之后再开始延迟创建
6、Empty、Never、Error
链接:http://reactivex.io/documentation/operators/empty-never-throw.html
概要说明:
Empty 只会执行订阅的onComplete
Never 啥流程都不执行,也不终止订阅
Error 执行onError,不执行onComplete
- Javadoc:
empty()
- Javadoc:
never()
- Javadoc:
error(Callable)
- Javadoc:
error(Throwable)
7、FromArray
链接:http://reactivex.io/documentation/operators/from.html
概要说明:
把数组当个item 单个单个发射出来
8、Generate 待补充: ======
9、interval
链接:http://reactivex.io/documentation/operators/interval.html
概要说明:
intervel:延时多少时间发射
intervalRange: 从哪开始 间隔多少 发射多少个数
10、just
链接:http://reactivex.io/documentation/operators/just.html
概要说明:
把一个对象转化为可观察者
11、merge
链接:http://reactivex.io/documentation/operators/merge.html
概要说明:
把多条生产线安装发射的时间合并成一条。
12、range(n,m)、rangeLong
链接:http://reactivex.io/documentation/operators/range.html
概要说明:
从n开始加1,一共加m-1次 一直到n+m-1
13、sequenceEqual
链接:http://reactivex.io/documentation/operators/sequenceequal.html
概要说明:
会对两个流水线的observble做对比,返回是否相同
14、switchOnNext
链接:http://reactivex.io/documentation/operators/switch.html
概要说明:
将发出Observables的Observable转换为单个Observable,替换掉。
15、timer
链接:http://reactivex.io/documentation/operators/timer.html
概要说明:
延时发射
待续=====
参考资料:
http://reactivex.io/documentation/operators.html
https://github.com/azhansy/RxJava2-Android-Samples.git