Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add delayed.js

  • Loading branch information...
commit 4c437f1a555fc1b5c00c567d7dacf1126db027c8 1 parent ffce7c3
@marcuswestin authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 delayed.js
View
11 delayed.js
@@ -0,0 +1,11 @@
+module.exports = function delayed(amount, fn) {
+ if (!fn) {
+ fn = amount
+ amount = 0
+ }
+ return function() {
+ var self = this
+ var args = arguments
+ setTimeout(function() { fn.apply(self, args) }, amount)
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.