Skip to content

Instantly share code, notes, and snippets.

@eSpecialized
Last active April 14, 2018 14:40
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 eSpecialized/0ca8046d2df4c8bfc4ca0528b6107aa4 to your computer and use it in GitHub Desktop.
Save eSpecialized/0ca8046d2df4c8bfc4ca0528b6107aa4 to your computer and use it in GitHub Desktop.
Simple RxSwift
import RxSwift
let bag = DisposeBag()
let publisher = PublishSubject<Int>()
publisher
.ignoreElements()
.subscribe(onCompleted: {
print("completed")
})
.disposed(by: bag)
publisher.onNext(3)
publisher.onCompleted()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment