Created
February 3, 2022 16:04
-
-
Save SebastianBoldt/2c861feb7200bcfeab6145fe27827f14 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
let task = Task { () -> String in | |
let text = try await requestTextFromServer() | |
return text | |
} | |
let newValue = try await task.value // Will only return if the Task did not throw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment