-
-
Save jasdev/67dd1174dcc42cb7a18dcb1831451ef5 to your computer and use it in GitHub Desktop.
EventConvertible sketch.
This file contains 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
protocol EventConvertible { | |
associatedtype Output | |
associatedtype Failure: Error | |
var event: Event<Output, Failure> { get } | |
} | |
extension Event: EventConvertible { | |
var event: Event<Output, Failure> { self } | |
} | |
extension Publisher where Output: EventConvertible { | |
func values() -> AnyPublisher<Output.Output, Never> { /// (1) With type-erased placeholders, for now. | |
fatalError("To be implemented.") | |
} | |
func errors() -> AnyPublisher<Output.Failure, Never> { /// (2) Same here. | |
fatalError("To be implemented.") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment