This file contains 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
Observable<LoginRequest> loginObservable = loginClickSubject | |
.withLatestFrom(lastCredentialsObservable, new Func2<Void, LoginRequest, LoginRequest>() { | |
@Override | |
public LoginRequest call(Void ignore, LoginRequest credentials) { | |
return credentials; | |
} | |
}); |
This file contains 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
Observable<LoginRequest> loginObservable = loginClickSubject | |
.flatMap(new Func1<Void, Observable<LoginRequest>>() { | |
@Override | |
public Observable<LoginRequest> call(Void ignore) { | |
return lastCredentialsObservable; | |
} | |
}); |
This file contains 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
Observable<LoginRequest> loginObservable = lastCredentialsObservable | |
.sample(loginClickSubject); |
This file contains 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
BehaviorSubject<String> emailSubject = BehaviorSubject.create(); | |
BehaviorSubject<String> passwordSubject = BehaviorSubject.create(); | |
PublishSubject<Void> loginClickSubject = PublishSubject.create(); |
This file contains 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
final Observable<LoginRequest> lastCredentialsObservable = Observable.combineLatest( | |
emailSubject, | |
passwordSubject, | |
new Func2<String, String, LoginRequest>() { | |
@Override | |
public LoginRequest call(String email, String password) { | |
return new LoginRequest(email, password); | |
} | |
}); |
NewerOlder