Created
February 14, 2013 07:46
-
-
Save wolfflow/4951194 to your computer and use it in GitHub Desktop.
Bacon.js user defined doubleclick
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
TIME_INTERVAL = 350 | |
clicked = Bacon.fromEventTarget(document.body, "click").toProperty() | |
clicked.combine(clicked.delay(TIME_INTERVAL), (a,b)-> | |
a isnt b and a.target is b.target and a.timeStamp - b.timeStamp <= TIME_INTERVAL | |
) | |
.filter((x)->x) | |
.assign((x)->console.log "DONE", x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment