Last active
March 21, 2021 16:30
-
-
Save markvanwijnen/e981568b4645d732d75c39ef387499bb to your computer and use it in GitHub Desktop.
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
self.subscriptions["oAuthAccessTokenSubscriber"] = | |
self.oAuthAccessTokenPublisher(temporaryCredentials: temporaryCredentials, | |
verifier: oAuthVerifier) // 1 | |
.receive(on: DispatchQueue.main) // 2 | |
.sink(receiveCompletion: { _ in // 3 | |
// Error handler | |
}, receiveValue: { [weak self] (tokenCredentials, user) in // 4 | |
guard let self = self else { return } | |
// 5 | |
self.subscriptions.removeValue(forKey: "oAuthRequestTokenSubscriber") | |
self.subscriptions.removeValue(forKey: "onOAuthRedirect") | |
self.subscriptions.removeValue(forKey: "oAuthAccessTokenSubscriber") | |
self.tokenCredentials = tokenCredentials // 6 | |
self.user = user // 7 | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment