You could also just use -take:
with a parameter of 1
:
RACSignal *originalSignal = [[RACSignal return:@"hello"] delay:10];
RACSignal *completesOnFirstValue = [originalSignal take:1];
If you don't want the signal to send a value before it completes, you can use -flattenMap:
as in your response, or you can use -takeUntil:
:
RACSignal *completesBeforeFirstValue = [originalSignal takeUntil:originalSignal];
(The -takeUntil:
operator will cause the signal to complete when the trigger signal fires before the value is delivered.)