I\'m just learning how to use Combine. I have experience with Rx (RxSwift and RxJava) and I\'m noticing that it\'s quite similar.
However, one thing that is quite differ
With opaque return the type is defined by what is exactly returned from closure, so you can use just
func createPublisher() -> some Publisher {
return Just(1)
}
let cancellable = createPublisher()
.print()
.sink(receiveCompletion: { _ in
print(">> done")
}) { value in
print(">> \(value)")
}
// ... all other code here
and it works. Tested with Xcode 11.4.