Tokamak icon indicating copy to clipboard operation
Tokamak copied to clipboard

Implement SubscriptionView compatible with OpenCombine

Open MaxDesiatov opened this issue 4 years ago • 0 comments

This is required for view subscriptions such as onReceive:

extension View {
  public func onReceive<P>(
    _ publisher: P, 
    perform action: @escaping (P.Output) -> ()
  ) -> some View where P : OpenCombine.Publisher, P.Failure == Never {
    SubscriptionView(content: self, publisher: publisher, action: action)
  }
}

MaxDesiatov avatar Jul 01 '20 19:07 MaxDesiatov