RACCommandExample icon indicating copy to clipboard operation
RACCommandExample copied to clipboard

`completedMessageSource` will be executed when completed or error.

Open ty0x2333 opened this issue 9 years ago • 0 comments

RACSignal *completedMessageSource = [self.subscribeCommand.executionSignals flattenMap:^RACStream *(RACSignal *subscribeSignal) {
    return [[[subscribeSignal materialize] filter:^BOOL(RACEvent *event) {
        return event.eventType == RACEventTypeCompleted;
    }] map:^id(id value) {
        return NSLocalizedString(@"Thanks", nil);
    }];
}];

completedMessageSource will be executed when completed or error.

Get completed signal, just need to concat.

RACSignal *completedMessageSource = [self.subscribeCommand.executionSignals concat];

see: Stack Overflow - Handling next, completed and error in ReactiveCocoa

ty0x2333 avatar Mar 07 '16 21:03 ty0x2333