With ReactiveCocoa I'm sure there is a better way than doing this?
RACSignal *crashSignal = [cancelSignal tryMap:^id(id value, NSError **errorPtr) {
*errorPtr = [self createError];
return nil;
}];
More idiomatic would be:
RACSignal *crashSignal = [cancelSignal flattenMap:^(id value) {
return [RACSignal error:[self createError]];
}];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With