Merge pull request #3 from ReactiveCocoa/racobserve

Bump to use newer RACObserve()
This commit is contained in:
Josh Abernathy
2013-07-19 08:26:24 -07:00
2 changed files with 5 additions and 12 deletions

View File

@@ -48,7 +48,7 @@ static const NSTimeInterval RVMViewModelInactiveThrottleInterval = 1;
if (_didBecomeActiveSignal == nil) {
@weakify(self);
_didBecomeActiveSignal = [[[RACObserve(self.active)
_didBecomeActiveSignal = [[[RACObserve(self, active)
filter:^(NSNumber *active) {
return active.boolValue;
}]
@@ -66,7 +66,7 @@ static const NSTimeInterval RVMViewModelInactiveThrottleInterval = 1;
if (_didBecomeInactiveSignal == nil) {
@weakify(self);
_didBecomeInactiveSignal = [[[RACObserve(self.active)
_didBecomeInactiveSignal = [[[RACObserve(self, active)
filter:^ BOOL (NSNumber *active) {
return !active.boolValue;
}]
@@ -100,7 +100,7 @@ static const NSTimeInterval RVMViewModelInactiveThrottleInterval = 1;
- (RACSignal *)forwardSignalWhileActive:(RACSignal *)signal {
NSParameterAssert(signal != nil);
RACSignal *activeSignal = RACObserve(self.active);
RACSignal *activeSignal = RACObserve(self, active);
return [[RACSignal
createSignal:^(id<RACSubscriber> subscriber) {
@@ -139,7 +139,7 @@ static const NSTimeInterval RVMViewModelInactiveThrottleInterval = 1;
signal = [signal replayLast];
return [[[[[RACObserve(self.active)
return [[[[[RACObserve(self, active)
takeUntil:[signal ignoreValues]]
combineLatestWith:signal]
throttle:RVMViewModelInactiveThrottleInterval valuesPassingTest:^ BOOL (RACTuple *xs) {
@@ -163,11 +163,4 @@ static const NSTimeInterval RVMViewModelInactiveThrottleInterval = 1;
return [super automaticallyNotifiesObserversForKey:key];
}
- (void)setNilValueForKey:(NSString *)key {
// Ignore attempts to set primitive properties to nil. This is commonly
// caused by RACObserve noticing an intermediate key change.
//
// See https://github.com/ReactiveCocoa/ReactiveCocoa/issues/631.
}
@end