I have a number of network requests and one or more of them will return valid data and is possible that some will return an error. How can I combine this request to stop once the first valid returned the data but not to stop in case of error.
I have try like this:
[[RACSignal merge:@[sigOne, sigTwo, sigThree]]
subscribeNext:^(RACTuple *myData){
NSLog(@"Data received");
} error:^(NSError *error) {
NSLog(@"E %@", error);
}
completed:^{
NSLog(@"They're all done!");
}
];
My problems:
- if one of the signals returns first with error then no next will be send. Not desired because one of the other signals will return valid data.
- if all three return valid data then the subscribeNext will be called three times but I would like to stop as soon I got some valid data (to reduce network traffic)