Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created August 15, 2021 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/0e06e3dd02ba8adcc631119581da8cab to your computer and use it in GitHub Desktop.
Save laevandus/0e06e3dd02ba8adcc631119581da8cab to your computer and use it in GitHub Desktop.
public func storeData(_ dataProvider: @escaping () -> Data?, identifier: Identifier = UUID().uuidString) async throws -> Identifier {
return try await withCheckedThrowingContinuation({ continuation in
self.storeData(dataProvider, identifier: identifier) { result in
continuation.resume(with: result)
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment