Created
February 14, 2013 12:29
-
-
Save wolfflow/4952468 to your computer and use it in GitHub Desktop.
prevent mousemove dupe values and sample with interval
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
$("body").asEventStream("mousemove") | |
.map((e)-> [e.screenX, e.screenY].join("")) | |
.toProperty() | |
.sample(100) | |
.skipDuplicates() | |
.map(->Date.now()) | |
.assign (x) -> | |
console.log x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment