doNext:
执行Next之前,会先执行这个Block
doCompleted:
执行sendCompleted之前,会先执行这个Block
[[[[RACSignal createSignal:^RACDisposable*(id subscriber) {
[subscriber sendNext:@"doNext"];
[subscriber sendCompleted];
return nil;
}]
doNext:^(idx) {//执行[subscriber sendNext:@"doNext"];前调用
NSLog(@"beforeDonext");
}]
doCompleted:^{//执行[subscriber sendCompleted];前调用
NSLog(@"afterDonext,beforeComplete");
}]
subscribeNext:^(idx) {
NSLog(@"%@",x);
}];