Permalink
Browse files

Added example for the context parameter

  • Loading branch information...
1 parent 961cb60 commit 6c7b2ff99f16086f843015730f9af6a4ddbcec42 @MoonScript committed Mar 6, 2013
Showing with 9 additions and 1 deletion.
  1. +9 −1 README.md
View
@@ -11,7 +11,15 @@ $.wait(500).then(function(){
});
```
-This is similar to [_.delay](http://underscorejs.org/#delay), except that you can cancel the *done* callbacks by calling `.reject()` on the returned Deferred object:
+Passing the *context* as the 2nd parameter:
+
+```JavaScript
+$.wait(500, someContext).then(function(){
+ this.something(); // "this" is the context parameter that you pass in
+});
+```
+
+This utility is similar to [_.delay](http://underscorejs.org/#delay), except that you can cancel the *done* callbacks by calling `.reject()` on the returned Deferred object:
```JavaScript
var deferred = $.wait(5000);

0 comments on commit 6c7b2ff

Please sign in to comment.