Last active
December 18, 2015 09:29
-
-
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.
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
// 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