Created
June 22, 2019 19:38
-
-
Save Arrlindii/9a0231cc57f70b7a9c58698139b47193 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let subject = PassthroughSubject<String, Never>() | |
| let publisher = subject.eraseToAnyPublisher() | |
| let subscriber = publisher.sink(receiveValue: { value in | |
| print(value) | |
| }) | |
| subject.send("Combine") //The Subscriber will print "Combine" | |
| subject.send("Swift") //The Subscriber will print "Swift" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment