Skip to content

Instantly share code, notes, and snippets.

@emarashliev
Last active May 1, 2019 10:42
Show Gist options
  • Save emarashliev/b0d8f06e69beb2cfc56b14ff39097603 to your computer and use it in GitHub Desktop.
Save emarashliev/b0d8f06e69beb2cfc56b14ff39097603 to your computer and use it in GitHub Desktop.
var array: [EventLoopFuture<T?>] = []
// do whatever to add futures to this array
EventLoopFuture<[T]>.reduce(into: [], array, on: eventLoop) {
if let value = $1 {
$0.append(value)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment