Created
February 23, 2022 01:27
-
-
Save Edudjr/e4fc14f01d5f68ee742f77dcf7ef0d38 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
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