Skip to content

Instantly share code, notes, and snippets.

@jacobp100
Created January 16, 2018 20:03
Show Gist options
  • Save jacobp100/e6758fdaf738cb2c480d7f492458b873 to your computer and use it in GitHub Desktop.
Save jacobp100/e6758fdaf738cb2c480d7f492458b873 to your computer and use it in GitHub Desktop.
Rx.Observable.from(store)
.map(state => state.isPlaying)
.distinctUntilChanged()
.subscribe(isPlaying => {
if (isPlaying) {
play()
} else {
pause()
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment