阅读源码之: ReactiveObjC第三篇RACSignal

2021-02-24  本文已影响0人  LV大树

RACStream 是抽象类,基类,代表任意流,代表monad, 在其上构建基于流的操作

monad/ 单子

基于RACStream 类派生的类有:
-> RACSequence -> RACSignalSequence,
-> RACStringSequence,
-> RACTupleSequence,
-> RACUnarySequence,

-> RACSignal -> RACSubject

基类的一些方法:(派生类必须实现 ,基类不能直接使用)
+(****)empty; //派生类必须实现 ,基类不能直接使用
+(****)return:(XXX); //派生类必须实现 ,基类不能直接使用
-(****)bind:(XXX); //派生类必须实现 ,基类不能直接使用
-(****)concat:(XXX);//派生类必须实现 ,基类不能直接使用
-(****)zipWith:(XXX);//派生类必须实现 ,基类不能直接使用

//以下为基类拓展方法(operation):日常操作使用,基类实现,派生类可不用实现
-(****)flattenMap:(XXX);
-(****)flatten;
-(****)map:(XXX);
-(****)mapReplace:(XXX);
-(****)filter:(XXX);
-(****)ignore:(XXX);
-(****)reduceEach:(XXX);
-(****)startWith:(XXX);
-(****)skip:(XXX);
-(****)take:(XXX);
-(****)zip:(XXX);
-(****)zip:(XXX) reduce :(XXX);
-(****)concat:(XXX);
-(****)scanWithStart:(XXX) reduce :(XXX);
-(****)scanWithStart:(XXX) reduceWithIndex :(XXX);
-(****)combinePreviousWithStart:(XXX) reduce :(XXX);
-(****)takeUntilBlock:(XXX);
-(****)takeWhileBlock:(XXX);
-(****)skipUntilBlock:(XXX);
-(****)skipWhileBlock:(XXX);
-(****)distinctUntilChanged ;

RACStream实现代码解读:

上一篇下一篇

猜你喜欢

热点阅读