addyosmani/backbone.paginator — pull request #45 by SBoudrias (2012-06-05 23:50:14+00:00)
Title: Add callback on requestPager calls

Methods changed are: requestNextPage, requestPreviousPage and pager from requestPager.

This commit add more consistency with the Backbone collections default .fetch() method
(http://documentcloud.github.com/backbone/#Collection-fetch) by letting
the user set options and by returning a jqXHR.

This will make it easier for user to:
* set {add: true} options (for example to use with infinite scroll)
* set callback on server response / page change

Example use case could be:

```javascript
myCollection
.requestNextPage({ add: true })
.done(function() {
// do something after request is received
})
.fail(function() {
// do something if request fail
})
```

Of course there's other way to do these kind of thing (like Backbone's reset event, add event, etc). But these kind of callback can be useful to manage state in the view (like showing/hiding a loader), etc. And this give consistency with the way native fetch() work in Backbone.