Skip to content

Instantly share code, notes, and snippets.

@ashfurrow
Last active December 15, 2015 17:09
Show Gist options
  • Save ashfurrow/5294706 to your computer and use it in GitHub Desktop.
Save ashfurrow/5294706 to your computer and use it in GitHub Desktop.
self.gitHubCommand = [RACCommand command];
self.gitHubSignal = [self.gitHubCommand addSignalBlock:^RACSignal *(id value) {
RACReplaySubject *subject = [RACReplaySubject subject];
[engine teamsInOrganization:@"TeehanLax" withSuccess:^(id result) {
for (NSDictionary *team in result)
{
[subject sendNext:team];
}
} failure:^(NSError *error) {
[subject sendError:error];
}];
return subject;
}];
[[self.gitHubSignal filter:^BOOL(id x) {
NSLog(@"%@", x); // Why is this not what I'm sending in sendNext:?
return YES;
// NSString *teamName = [team valueForKey:@"name"];
// return [teamName isEqualToString:@"General"];
}] subscribeNext:^(NSDictionary *team) {
NSInteger teamID = [[team valueForKey:@"id"] intValue];
NSLog(@"Team ID: %lu", teamID);
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment