mirror of
https://github.com/zhigang1992/ReactiveViewModel.git
synced 2026-01-12 22:51:31 +08:00
Merge pull request #3 from ReactiveCocoa/racobserve
Bump to use newer RACObserve()
This commit is contained in:
2
External/ReactiveCocoa
vendored
2
External/ReactiveCocoa
vendored
Submodule External/ReactiveCocoa updated: d942f4275d...d1cddcef52
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user