Created
October 14, 2015 15:14
-
-
Save gsans/4a195069c9835c5b0cf8 to your computer and use it in GitHub Desktop.
Idle user snippet
This file contains 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
mergedStreams = rx.Observable.merge( | |
rx.DOM.keydown(document), | |
rx.DOM.click(document), | |
rx.DOM.mousemove(document), | |
rx.DOM.scroll(document), | |
rx.DOM.touchstart(document) | |
); | |
var idleStream = mergedStreams | |
.bufferWithTime(5000) | |
.filter(function(arr){ | |
return arr.length===0; | |
}) | |
.subscribe(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment