RxJS开发指南
基本概念
时钟示例
重构 - 观测者模式
重构 - 使用RxJS
RxJS - 错误/结束通知
RxJS - 扩展
Marble Diagram - 宝石图
可视化工具
序列的创建与还原
从零开始创建 - create
预定义序列 - empty/never/throw
创建整数序列 - range
创建周期序列 - interval
创建延时周期序列 - timer
数据集转化 - from / pairs
参数转化 - of
创建单值序列 - just
创建重复值序列 - repeat
创建事件序列 - fromEvent/fromEventPattern
还原为Array - toArray
还原为Map - toMap
还原为Set - toSet
序列的常用变换
延迟 - delay
附加时间间隔 - timeInterval
超时报警 - timeout
附加时间戳 - timestamp
序列循环 - doWhile/while
序列的成员映射
映射 - map
属性映射 - pluck
平坦化映射 - flatMap
活动序列平坦化映射 - flatMapLatest
通知的平坦化映射 - flatMapObserver
拼接映射 - concatMap
通知的拼接映射 - concatMapObserver
序列的归约与聚合运算
归约 - reduce
均值 - average
总和/总数 - sum/count
最大值 - max/maxBy
最小值 - min/minBy
序列的成员过滤
过滤 - filter
按数量跳过 - skip/skipLast
按时间跳过 - skipUntilWithTime/skipLastWithTime
按条件跳过 - skipWhile
按数量截取 - take/takeLast
按时间截取 - takeUtilWithTime/takeLastWithTime
按条件截取 - takeWhile
剔除重复值 - distinct/distinctUntilChanged
位置过滤 - elementAt
模式查找 - first/last/find/findIndex
值忽略 - ignoreElements
序列的打包、开窗与分组
打包 - buffer
按数量打包 - bufferWithCount/bufferWithTimeOrCount
按时间打包 - bufferWithTime
开窗 - window
按数量开窗 - windowWithCount/windowWithTimeOrCount
按时间开窗 - windowWithTime
分组 - groupBy
分段分组 - groupByUntil
多序列的组合运算
序列拼接 - concat/concatAll
最新值合并 - combineLatest
合并最新值 - withLatestFrom
序列融合 - merge/mergeAll
前缀序列 - startWith
序列切换 - switch
按序组合 - zip
尾值组合 - forkJoin
序列的错误与断言处理
错误时执行 - catch
继续执行 - onErrorResumeNext
错误时重新订阅 - retry
30:00
有问题?问助教!