I have an Observable whose emitted item I need for the next Observable but I can't use flatMap() because the method I need to call in the Subscriber needs the result of both Observables.
service.getToken(code)
.subscribe(new Action1<Token>() {
@Override
public void call(Token token) {
service.getProfile(token.getAccessToken())
.subscribe(
new Action1<Profile>() {
@Override
public void call(Profile profile) {
createAccount(token, profile);
}
});
}
});
Any better approach then this?
I have an Observable whose emitted item I need for the next Observable but I can't use flatMap() because the method I need to call in the Subscriber needs the result of both Observables.
Any better approach then this?