Dealing with errors in 5.0.0
#183
-
Hi, i am using your library in storyboard project (not using swiftUI) , how can I call the api to get user , I saw your example :
receiveValue closure is not optional , how can I check if api failed to get user for identifier ? |
Beta Was this translation helpful? Give feedback.
Answered by
sbertix
May 6, 2021
Replies: 2 comments 5 replies
-
Never mind I figured it out. |
Beta Was this translation helpful? Give feedback.
1 reply
-
I'm still gonna add a reply for future reference, in case anybody else wonders. // Make sure this is retained!
var bin: Set<AnyCancellable> = []
Endpoint.user(secret.identifier)
.unlock(with: secret)
.session(.instagram)
.sink {
switch $0 {
case .failure(let error): break
default: break
}
} receiveValue: {
print("output", $0)
}
.store(in: &bin) |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
sbertix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm still gonna add a reply for future reference, in case anybody else wonders.