Skip to content

Instantly share code, notes, and snippets.

@ibrahimkteish
Last active September 28, 2016 07:10
Show Gist options
  • Save ibrahimkteish/369ce8d2aa58ea99dc6af594f7943ba6 to your computer and use it in GitHub Desktop.
Save ibrahimkteish/369ce8d2aa58ea99dc6af594f7943ba6 to your computer and use it in GitHub Desktop.
RxSwift Variable type
do {
let disposeBag = DisposeBag()
let variable = Variable("A")
variable.value = "B"
variable.asObservable()
.subscribe { print($0) }
.addDisposableTo(disposeBag)
variable.value = "C"
variable.asObservable()
.subscribe { print("Second subscription:", $0) }
.addDisposableTo(disposeBag)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment