Skip to content

Instantly share code, notes, and snippets.

@stigi
Created August 19, 2014 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stigi/3f539a92352ec0e24110 to your computer and use it in GitHub Desktop.
Save stigi/3f539a92352ec0e24110 to your computer and use it in GitHub Desktop.
RACSignal from RACCommand is not subscribed to by `-waitUntilCompleted:`
[[[RACSignal return:@"returnValue"] logAll] waitUntilCompleted:nil];
NSLog(@"Done waiting for return");
RACCommand *c = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id _) {
NSLog(@"Execute command");
return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
NSLog(@"Command Signal subscribed");
[subscriber sendNext:@"commandValue"];
[subscriber sendCompleted];
return nil;
}];
}];
[[[c execute:nil] logAll] waitUntilCompleted:nil];
NSLog(@"Done waiting for command");
2014-08-19 12:41:04.072 RACPlayground[47616:60b] <RACReturnSignal: 0x8f9ed30> name: next: returnValue
2014-08-19 12:41:04.073 RACPlayground[47616:60b] <RACDynamicSignal: 0x8fbf730> name: completed
2014-08-19 12:41:04.074 RACPlayground[47616:60b] Done waiting for return
2014-08-19 12:41:04.080 RACPlayground[47616:60b] Execute command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment