objective c - ReactiveCocoa merge that completes when input signal completes -


in reactivecocoa, there mechanism similar merge: completes when of signals being merged complete?

i found workaround involves concatenating input signal [racsignal return:foo] , adding take:1 after merge, seems rather long-winded. there simpler way?

not built-in reactivecoca. should define in helper category on racsignal, long-windedness hidden behind nice method abstraction.

here's (untested) example using materialize, give signal of signal events don't need append onto input signals:

+ (racsignal *)sheepishmerge:(nsarray *)signals {     racsequence *completions = [signals.rac_sequence map:^(racsignal *signal) {         return [[signal materialize] filter:^(racevent *event) {             return event.eventtype == raceventtypecompleted;         }];     }];      racsignal *firstcompletion = [[racsignal merge:completions] take:1];      return [[racsignal merge:signals] takeuntil:firstcompletion]; } 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -