Last active
December 11, 2015 07:29
-
-
Save joshaber/4566694 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[[[[[[[[[self.searchTextField | |
rac_textSignal] | |
filter:^BOOL(NSString *value) { | |
return value.length > 2; | |
}] | |
doNext:^(NSString *x) { | |
NSLog(@"[%@] Text Changed: %@", [NSThread currentThread], x); | |
}] | |
throttle: .6] | |
doNext:^(id x) { | |
NSLog(@"[%@] Throttle Changed: %@", [NSThread currentThread], x); | |
}] | |
doNext:^(NSString *x) { | |
self.recentList.text = [NSString stringWithFormat:@"%@ \n%@", self.recentList.text, x]; | |
}] | |
subscribeOn:[RACScheduler mainThreadScheduler]] | |
flattenMap:^RACStream *(id value) { | |
return [self searchTwitter:value]; | |
}] | |
flattenMap:^(NSArray *xs) { | |
return [RACSignal createSignal:^ id (id<RACSubscriber> subscriber) { | |
for (id x in xs) { | |
[subscriber sendNext:x]; | |
} | |
[subscriber sendCompleted]; | |
return nil; | |
}]; | |
}] | |
subscribeNext:^(TwitterInstantSearchModel *x) { | |
self.searchResults.text = [NSString stringWithFormat:@"%@ \n%@", self.searchResults.text, x]; | |
NSLog(@"%@", x); | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment