Skip to content

Instantly share code, notes, and snippets.

@Edudjr
Created February 23, 2022 01:27
Show Gist options
  • Save Edudjr/e4fc14f01d5f68ee742f77dcf7ef0d38 to your computer and use it in GitHub Desktop.
Save Edudjr/e4fc14f01d5f68ee742f77dcf7ef0d38 to your computer and use it in GitHub Desktop.
class Client1 {
var cancellable: AnyCancellable?
let api = API()
func loadTodo() {
cancellable = api.loadTodo()
.sink(receiveCompletion: { result in
switch result {
case .finished:
print("finished")
case .failure:
print("failed")
}
}, receiveValue: { todo in
print(todo)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment