Instance Method

handleEvents(receiveSubscription:receiveOutput:receiveCompletion:receiveCancel:receiveRequest:)

Performs the specified closures when publisher events occur.

Declaration

func handleEvents(receiveSubscription: ((Subscription) -> Void)? = nil, receiveOutput: ((Prefix.Output) -> Void)? = nil, receiveCompletion: ((Subscribers.Completion<Prefix.Failure>) -> Void)? = nil, receiveCancel: (() -> Void)? = nil, receiveRequest: ((Subscribers.Demand) -> Void)? = nil) -> Publishers.HandleEvents<Publishers.Concatenate<Prefix, Suffix>>

Parameters

receiveSubscription

A closure that executes when the publisher receives the subscription from the upstream publisher. Defaults to nil.

receiveOutput

A closure that executes when the publisher receives a value from the upstream publisher. Defaults to nil.

receiveCompletion

A closure that executes when the publisher receives the completion from the upstream publisher. Defaults to nil.

receiveCancel

A closure that executes when the downstream receiver cancels publishing. Defaults to nil.

receiveRequest

A closure that executes when the publisher receives a request for more elements. Defaults to nil.

Return Value

A publisher that performs the specified closures when publisher events occur.

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