-
-
Save laevandus/3bf1bd0209ee076f6a4c3a4add32fe72 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
actor Storage { | |
private var contents = [String: Data]() | |
func store(_ data: Data, forIdentifier id: String) { | |
contents[id] = data | |
} | |
var numberOfItems: Int { contents.count } | |
} | |
// Example: | |
// await storage.store(data, forIdentifier: id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment