Created
September 27, 2016 15:21
-
-
Save ivanbruel/27bd6c37aab63c461cbf036b1086b106 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