Skip to content

Instantly share code, notes, and snippets.

@onmyway133
Created January 8, 2019 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onmyway133/32f0803ab8bfe591adc6a41e2fddd054 to your computer and use it in GitHub Desktop.
Save onmyway133/32f0803ab8bfe591adc6a41e2fddd054 to your computer and use it in GitHub Desktop.
a.swift
import Foundation
public enum Event<T> {
case Next(value: T)
case Failed(error: ErrorType)
// MARK: Initialization
public init(value: T) {
self = .Next(value: value)
}
public init(error: ErrorType) {
self = .Failed(error: error)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment