Rac范型

作者: 我是小胡胡分胡 | 来源:发表于2018-02-11 15:26 被阅读84次

RACStream 、RACSignal 、RACSequence

typedef RACSequence * _Nullable (^RACSequenceBindBlock)(ValueType _Nullable value, BOOL *stop);
typedef RACSignal * _Nullable (^RACSignalBindBlock)(ValueType _Nullable value, BOOL *stop);
typedef RACStream * _Nullable (^RACStreamBindBlock)(ValueType _Nullable value, BOOL *stop);

在实现体中,其实是
//我们就可以使用泛型和__kindof来解决这个问题。 RACStream或者RACStream的子类

  • (__kindof RACStream *)bind:(RACStreamBindBlock (^)(void))block;
  • (__kindof RACStream *)concat:(RACStream *)stream;
  • (__kindof RACStream *)zipWith:(RACStream *)stream;
  • (__kindof RACStream *)flattenMap:(__kindof RACStream * _Nullable (^)(ValueType _Nullable value))block;
  • (__kindof RACStream *)flatten;
  • (__kindof RACStream *)map:(id _Nullable (^)(ValueType _Nullable value))block;
  • (__kindof RACStream *)mapReplace:(nullable id)object;
  • (__kindof RACStream<ValueType> *)filter:(BOOL (^)(ValueType _Nullable value))block;
  • (__kindof RACStream<ValueType> *)ignore:(nullable ValueType)value;
  • (__kindof RACStream *)reduceEach:(id _Nullable (^)())reduceBlock;
  • (__kindof RACStream<ValueType> *)startWith:(nullable ValueType)value;
  • (__kindof RACStream<ValueType> *)skip:(NSUInteger)skipCount;
  • (__kindof RACStream<ValueType> *)take:(NSUInteger)count;
  • (__kindof RACStream *)scanWithStart:(nullable id)startingValue reduce:(id _Nullable (^)(id _Nullable running, ValueType _Nullable next))reduceBlock;
  • (__kindof RACStream *)scanWithStart:(nullable id)startingValue reduceWithIndex:(id _Nullable (^)(id _Nullable running, ValueType _Nullable next, NSUInteger index))reduceBlock;
  • (__kindof RACStream *)combinePreviousWithStart:(nullable ValueType)start reduce:(id _Nullable (^)(ValueType _Nullable previous, ValueType _Nullable current))reduceBlock;
  • (__kindof RACStream<ValueType> *)takeUntilBlock:(BOOL (^)(ValueType _Nullable x))predicate;
  • (__kindof RACStream<ValueType> *)takeWhileBlock:(BOOL (^)(ValueType _Nullable x))predicate;
  • (__kindof RACStream<ValueType> *)skipUntilBlock:(BOOL (^)(ValueType _Nullable x))predicate;
  • (__kindof RACStream<ValueType> *)skipWhileBlock:(BOOL (^)(ValueType _Nullable x))predicate;
  • (__kindof RACStream<ValueType> *)distinctUntilChanged;
  • (__kindof RACStream *)empty {
  • (__kindof RACStream *)return:(id)value {
  • (__kindof RACStream *)join:(id<NSFastEnumeration>)streams block:(RACStream * (^)(id, id))block {
  • (__kindof RACStream *)zip:(id<NSFastEnumeration>)streams {
  • (__kindof RACStream *)zip:(id<NSFastEnumeration>)streams reduce:(id (^)())reduceBlock {
  • (__kindof RACStream *)concat:(id<NSFastEnumeration>)streams {
  • (RACSignal<RACTuple *> *)combineLatest:(id<NSFastEnumeration>)signals RAC_WARN_UNUSED_RESULT;
  • (RACSignal<ValueType> *)combineLatest:(id<NSFastEnumeration>)signals reduce:(ValueType _Nullable (^)())reduceBlock RAC_WARN_UNUSED_RESULT;
  • (RACSignal<ValueType> *)merge:(id<NSFastEnumeration>)signals RAC_WARN_UNUSED_RESULT;
  • (RACSignal<NSDate *> *)interval:(NSTimeInterval)interval onScheduler:(RACScheduler *)scheduler RAC_WARN_UNUSED_RESULT;
  • (RACSignal<NSDate *> *)interval:(NSTimeInterval)interval onScheduler:(RACScheduler *)scheduler withLeeway:(NSTimeInterval)leeway RAC_WARN_UNUSED_RESULT;
  • (RACSignal<ValueType> *)try:(nullable ValueType (^)(NSError **errorPtr))tryBlock RAC_WARN_UNUSED_RESULT;
  • (RACSignal<ValueType> *)defer:(RACSignal<ValueType> * (^)(void))block RAC_WARN_UNUSED_RESULT;
  • (RACSignal<ValueType> *)switch:(RACSignal *)signal cases:(NSDictionary *)cases default:(nullable RACSignal *)defaultSignal RAC_WARN_UNUSED_RESULT;
  • (RACSignal<ValueType> *)if:(RACSignal<NSNumber *> *)boolSignal then:(RACSignal *)trueSignal else:(RACSignal *)falseSignal RAC_WARN_UNUSED_RESULT;

相关文章

  • Rac范型

    RACStream 、RACSignal 、RACSequence typedef RACSequence *...

  • CoreJava笔记 - 范型程序设计(2)

    范型代码和Java虚拟机 关键知识:类型擦除Java的范型是编译器层次的范型,而在Java虚拟机上并没有范型类。在...

  • 范型

    <:上界 >:下界 <%视图定界 一定要传隐式转换函数 T隐式转换成order[T][T<%M]关系意味着...

  • 范型

    范型就是不指定类型,用的时候在指定类型使用场景 用在构造函数中

  • 范型

    泛型是jdk1.5使用的新特性。 泛型的好处:1. 将运行时的异常提前至了编译时。2. 避免了无谓的强制类型转换 ...

  • 范型

  • Objective-C 范型

    系统库范型 Objective C支持轻量级的范型。在编写自定义的范型类之前,我们先来看看Cocoa Touch的...

  • CoreJava笔记 - 范型程序设计(5)

    反射与范型 由于类型擦除,反射无法得到关于范型类型参数的信息。 范型的Class类在Java的反射库中,Class...

  • ReactiveCocoa 4上手实践1:创建自定义信号

    随着Swift引入了类型安全的特性(泛型、类型推断),在RAC 3.0+后的使用与OC的RAC 2.5已经有了很大...

  • Flutter 类方法和基础语法(II) - 范型

    范型限制

网友评论

      本文标题:Rac范型

      本文链接:https://www.haomeiwen.com/subject/zyoktftx.html