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.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software