Created
September 27, 2016 15:22
-
-
Save ivanbruel/5c96c63b10da56c43bfb2fb6fab86819 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
func login() -> Observable<Void> { | |
return Observable.combineLatest(twitterSession(), Observable.just(Globals.UUID)) { ($0, $1) } | |
.flatMap { (twitterSession, uuid) in | |
Network.request(PhoenixAPI.TwitterLogin(authToken: twitterSession.authToken, | |
authTokenSecret: twitterSession.authTokenSecret, uid: uuid)) | |
} | |
.filterSuccessfulStatusCodes() | |
.debug() | |
.mapObject(Session) | |
.doOnNext { [weak self] (session: Session) in | |
self?.session = session | |
} | |
.map(void) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment