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
private func fetchData() -> Promise<[Int]> { | |
return Promise { seal in | |
let someData = (1...100_000).map { _ in Int.random(in: (1...100)) } | |
seal.fulfill(someData) | |
} | |
} | |
private func calculateMinMax(forData array: [Int]) -> Promise<(Int, Int)> { | |
return Promise { seal in | |
guard let first = array.first else { |