Instance Method

sink(receiveValue:)

Attaches a subscriber with closure-based behavior to a publisher that never fails.

Declaration

func sink(receiveValue: @escaping ((DeferredPublisher.Output) -> Void)) -> AnyCancellable
Available when Failure is Never.

Parameters

receiveValue

The closure to execute on receipt of a value. If nil, the sink uses an empty closure.

Return Value

A subscriber that performs the provided closure upon receiving values.