Type Alias

Future.Promise

A type that represents a closure to invoke in the future, when an element or error is available.

Declaration

typealias Future<Output, Failure>.Promise = (Result<Output, Failure>) -> Void

Discussion

The promise closure receives one parameter: a Result that contains either a single element published by a Future, or an error.

See Also

Creating a Future

init((@escaping Future<Output, Failure>.Promise) -> Void)

Creates a publisher that invokes a promise closure when the publisher emits an element.