Skip to content

Instantly share code, notes, and snippets.

@voltidev
Created February 20, 2013 08:06
Show Gist options
  • Save voltidev/4993821 to your computer and use it in GitHub Desktop.
Save voltidev/4993821 to your computer and use it in GitHub Desktop.
Small coffee-script aliases for setTimeout and setInterval
after = (ms, cb) -> setTimeout cb, ms
every = (ms, cb) -> setInterval cb, ms

Now we can say:

after 500, -> # do something...

Instead of:

setTimeout ->
    # do something..
, 500
@DannyBen
Copy link

Lovely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment