Skip to content

Commit

Permalink
Fixes #1468 -- add a 'request' event that allows folks to watch for s…
Browse files Browse the repository at this point in the history
…pinners etc. Passes the XHR on which you can .then, .error, and so on.
  • Loading branch information
jashkenas committed Dec 10, 2012
1 parent 615b08c commit ec97a1c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,9 @@
};

// Make the request, allowing the user to override any Ajax options.
return Backbone.ajax(_.extend(params, options));
var xhr = Backbone.ajax(_.extend(params, options));
model.trigger('request', model, xhr, options);
return xhr;
};

// Set the default implementation of `Backbone.ajax` to proxy through to `$`.
Expand Down

0 comments on commit ec97a1c

Please sign in to comment.