Skip to content

Instantly share code, notes, and snippets.

@wolfflow
Created February 14, 2013 07:56
Show Gist options
  • Save wolfflow/4951227 to your computer and use it in GitHub Desktop.
Save wolfflow/4951227 to your computer and use it in GitHub Desktop.
another Bacon.js user defined doubleclick
TIME_INTERVAL = 350
clicked = Bacon.fromEventTarget(document.body, "click")
clicked.bufferWithCount(2)
.map((x) -> x[1].timeStamp - x[0].timeStamp)
.filter((x) -> x <= TIME_INTERVAL)
.assign((x) -> console.log "Done in #{x}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment