Created
January 16, 2018 20:03
-
-
Save jacobp100/e6758fdaf738cb2c480d7f492458b873 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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