Permalink
Browse files

Adding can.defer to function.js

  • Loading branch information...
Ralph Holzmann
Ralph Holzmann committed May 31, 2012
1 parent 1acf841 commit 64de5254ce8c284b20c3da487638497457152105
Showing with 11 additions and 0 deletions.
  1. +11 −0 util/function/function.js
View
@@ -39,6 +39,17 @@ steal("can/util", function() {
}
}
+ },
+
+ defer : function( fn, context ) {
+
+ var args = arguments;
+ context = context || this;
+
+ setTimeout(function() {
+ fn.apply( context, args );
+ }, 0 );
+
}
});

0 comments on commit 64de525

Please sign in to comment.