-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
StorageManager
and VDCCollection
API usage (#81)
Signed-off-by: Tiago Nascimento <[email protected]> Co-authored-by: Gregorio <[email protected]>
- Loading branch information
1 parent
a027834
commit 57532e4
Showing
5 changed files
with
70 additions
and
40 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Foundation | ||
|
||
extension Sequence { | ||
func asyncMap<T>(_ transform: @escaping (Element) async throws -> T) async rethrows -> [T] { | ||
var results = [T]() | ||
for element in self { | ||
let result = try await transform(element) | ||
results.append(result) | ||
} | ||
return results | ||
} | ||
} | ||
|
||
extension Sequence { | ||
func asyncForEach( | ||
_ operation: (Element) async throws -> Void | ||
) async rethrows { | ||
for element in self { | ||
try await operation(element) | ||
} | ||
} | ||
} |
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