Skip to content

Instantly share code, notes, and snippets.

@rarmatei
Last active October 22, 2017 20:19
Show Gist options
  • Save rarmatei/bc6fab6b7b4748cc320bdd3ca36bdfb5 to your computer and use it in GitHub Desktop.
Save rarmatei/bc6fab6b7b4748cc320bdd3ca36bdfb5 to your computer and use it in GitHub Desktop.
subscribeUpdates
.scan((total, change) => change + total, 0)
.switchMap(count => {
return count === 0
? Observable.timer(delay)
.do(_ => /* tear-down logic */ )
: Observable.never();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment