Skip to content

Instantly share code, notes, and snippets.

@saru2020
Created May 21, 2019 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save saru2020/79d48779eeee745788bc4bb11ecc3661 to your computer and use it in GitHub Desktop.
Save saru2020/79d48779eeee745788bc4bb11ecc3661 to your computer and use it in GitHub Desktop.
let disposeBag = DisposeBag()
let heySequence = Observable.from(["H","e","y"])
let subscription = heySequence.subscribe { event in
switch event {
case .next(let value):
print("onNext, Event: \(value)")
case .error(let error):
print(error)
case .completed:
print("onCompleted")
}
}
subscription.disposed(by: disposeBag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment