Skip to content

Commit

Permalink
Added example for the context parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Moon committed Mar 6, 2013
1 parent 961cb60 commit 6c7b2ff
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6c7b2ff

Please sign in to comment.