Skip to content

Instantly share code, notes, and snippets.

@SebastianBoldt
Last active February 3, 2022 09:53
Show Gist options
  • Save SebastianBoldt/4ba76d8f6195c54f469f3f0bb813ad48 to your computer and use it in GitHub Desktop.
Save SebastianBoldt/4ba76d8f6195c54f469f3f0bb813ad48 to your computer and use it in GitHub Desktop.
func getStatistics(for user: User) async throws -> (Statistics, Statistics) {
async let old = getOldUserStatistics(of: user)
async let new = getNewUserStatistics(of: user)
let awaitedOldStats = await old
let awaitedNewStats = await new
return (awaitedOldStats, awaitedNewStats)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment