Skip to content

Instantly share code, notes, and snippets.

@andyarvanitis
Last active December 18, 2015 09:29
Show Gist options
  • Save andyarvanitis/5761964 to your computer and use it in GitHub Desktop.
Save andyarvanitis/5761964 to your computer and use it in GitHub Desktop.
Another little eero ReactiveCocoa example. This one is from one of the official examples from GitHub.
// Only log names that start with "j".
// Objective-C version...
[[RACAble(self.username)
filter:^(NSString *newName) {
return [newName hasPrefix:@"j"];
}]
subscribeNext:^(NSString *newName) {
NSLog(@"%@", newName);
}];
// Eero version...
RACAble(self.username).filter: (String newName | return newName.hasPrefix:'j'),
subscribeNext: (String newName | Log('%@', newName))
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment