philschatz/octokit.js — pull request #35 by philschatz (2014-04-20 14:46:00+00:00)
Title: WIP: Support paged results

Several methods (like `getCommits`) return multipage results. This adds methods to navigate through the results.

Since promises return a single value these methods are added to the returned JSON.

TODO:

- [ ] Support Iterable API

Adding support for iterable is a bit annoying because it should iterate over each result in the page and once it has reached the end, async fetch a new page.

I think this means that the iterator either has to sometimes return a value and sometimes a Promise or always return a Promise for each result in the page.

Thoughts?