Skip to content

Instantly share code, notes, and snippets.

@danekja
Created August 6, 2014 14:55
Show Gist options
  • Save danekja/ce7c782193b4472dbc7b to your computer and use it in GitHub Desktop.
Save danekja/ce7c782193b4472dbc7b to your computer and use it in GitHub Desktop.
processing = no
work = () ->
processing = yes
doSomeWork (e) ->
processing = no
if not processing
work()
else
int = setInterval () ->
if not processing
clearInterval int
work()
, 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment