ݺͼग़͠ଆ#FGPSF"GUFS
• Before
import InhouseClient
let deferred = client.loginAsync(email: "
[email protected]",password:"password")
deferred.invokeOnCompletion(cause in
let response = deferred.getCompleted()
if let result = response as? Response.Success {
if let success = result as! LoginSuccess {
doSomething(user: success.user)
}
}
})
• After
import InhouseClientSwifty
client.login(email: "
[email protected]",password: "password")
.sink(receiveValue: { value in
doSomething(user: value.user)
}, receiveCompletion { completion in
handle(completion)
})