Skip to content

Instantly share code, notes, and snippets.

@jasdev
Last active April 14, 2020 19:01
Show Gist options
  • Save jasdev/484933d93bf7de017f80b8ccacc621ba to your computer and use it in GitHub Desktop.
Save jasdev/484933d93bf7de017f80b8ccacc621ba to your computer and use it in GitHub Desktop.
`.cher` sans `autoconnect` attempt.
import PlaygroundSupport /// (1) Adding the needed Playground-related import.
PlaygroundPage.current.needsIndefiniteExecution = true
extension Publisher {
func cher() -> Publishers.Multicast<Self, PassthroughSubject<Output, Failure>> { /* … */ }
}
var subscriptions = Set<AnyCancellable>()
Just(1)
.cher()
.sink { print($0) }
.store(in: &subscriptions)
/// (2) Aaand no logs are outputted. Houston, we have a problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment