mirror of
https://github.com/zhigang1992/FunctionalReactivePixels.git
synced 2026-01-12 22:47:31 +08:00
Broke reference cycle in FRPLoginViewModel.
This commit is contained in:
@@ -21,9 +21,11 @@
|
||||
self = [super init];
|
||||
if (!self) return nil;
|
||||
|
||||
@weakify(self);
|
||||
self.loginCommand = [[RACCommand alloc] initWithEnabled:[RACSignal combineLatest:@[RACObserve(self, username), RACObserve(self, password)] reduce:^id(NSString *username, NSString *password){
|
||||
return @(username.length > 0 && password.length > 0);
|
||||
}] signalBlock:^RACSignal *(id input) {
|
||||
@strongify(self);
|
||||
return [FRPPhotoImporter logInWithUsername:self.username password:self.password];
|
||||
}];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user