Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
`EventConvertible` enumeration properties.
extension EventConvertible {
var value: Output? {
switch event {
case let .value(value):
return value
case .completion:
return nil
}
}
var error: Failure? {
switch event {
case let .completion(.failure(error)):
return error
case .value, .completion(.finished):
return nil
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment