Skip to content

Instantly share code, notes, and snippets.

@pangers
Last active February 21, 2016 05:43
Show Gist options
  • Save pangers/db4be72d0ecffdabf9a7 to your computer and use it in GitHub Desktop.
Save pangers/db4be72d0ecffdabf9a7 to your computer and use it in GitHub Desktop.
let timer = Observable<Int>.interval(1, scheduler: MainScheduler.instance)
timer.subscribeNext {
print("First Subscription: \($0)")
}
delay(2) {
timer.subscribeNext {
print("Second Subscription: \($0)")
}
}
//First Subscription: 0
//First Subscription: 1
//First Subscription: 2
//Second Subscription: 0
//First Subscription: 3
//Second Subscription: 1
//First Subscription: 4
//Second Subscription: 2
//..
//..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment