-
-
Save laevandus/6e403cd46627e271a76ce4237b03a4ad 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
public func loadData<T>(forIdentifier identifier: Identifier, dataTransformer: @escaping (Data) -> T?) async -> T? { | |
return await withCheckedContinuation({ continuation in | |
self.loadData(forIdentifier: identifier, dataTransformer: dataTransformer) { object in | |
continuation.resume(returning: object) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment