Other Functions

The following functions are available globally.

  • Waits on all provided promises, then resolves to the result of the successful ones.

    • Param onError: A callback that is called each time any promise fails, with the index of the promise and the error.

    Declaration

    Swift

    public func successes<T>(_ promises: [Promise<T>], onError: @escaping (Int, Error) -> Void)
    -> Promise<[T]>

    Return Value

    A new promise that resolves once all the provided promises resolve, containing an array of the results from the successful promises.