subscribe(_:)
Attaches the specified subscriber to this publisher.
Declaration
func subscribe<S>(_ subscriber: S) where Output == S.Input, S : Subscriber, S.Failure == any ErrorParameters
- subscriber:
The subscriber to attach to this publisher. After attaching, the subscriber can start to receive values.
Discussion
Always call this function instead of Publisher/receive(subscriber:). Adopters of Publisher must implement Publisher/receive(subscriber:). The implementation of Publisher/subscribe(_:)-4u8kn provided by Publisher calls through to Publisher/receive(subscriber:).