Generic Instance Method


Adds an action to perform when this view detects data emitted by the given publisher.


func onReceive<P>(_ publisher: P, perform action: @escaping (P.Output) -> Void) -> some View where P : Publisher, P.Failure == Never

See Also

Handling Publisher Events

struct SubscriptionView

A view that subscribes to a publisher with an action.