Initializer

init(receiveSubscription:receiveValue:receiveCompletion:)

Creates a type-erasing subscriber that executes the provided closures.

Declaration

init(receiveSubscription: ((Subscription) -> Void)? = nil, receiveValue: ((Input) -> Subscribers.Demand)? = nil, receiveCompletion: ((Subscribers.Completion<Failure>) -> Void)? = nil)

Parameters

receiveSubscription

A closure to execute when the subscriber receives the initial subscription from the publisher.

receiveValue

A closure to execute when the subscriber receives a value from the publisher.

receiveCompletion

A closure to execute when the subscriber receives a completion callback from the publisher.

See Also

Creating a Type-Erased Subscriber

init<S>(S)

Creates a type-erasing subscriber to wrap an existing subscriber.