TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2015 |
Maintained by Daniel Thengvall.
[[[DTObservable alloc] init:^(DTSubscriber *subscriber) {
// Setup some data
NSDictionary *value = @{@"4": @20};
// Lets pretend something cpu intensive happens here
[NSThread sleepForTimeInterval:1.f];
// Notify the subscriber
[subscriber next:value];
[subscriber complete];
}] subscribe:[[DTSubscriber alloc] init:^(NSDictionary *value) {
// Confirm the result
BOOL fourTwenty = [value[@"4"] intValue] == 20;
// Success!
NSLog(@"Does 4 == 20? %@", fourTwenty ? @"YES" : @"NO");
} onError:^(NSError *error) {
NSLog(@"%@", error);
}]];
DTObservable is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'DTObservable', '0.4.5'
DTHENG, [email protected]
DTObservable is available under the MIT license. See the LICENSE file for more info.