Skip to content

Commit

Permalink
docs: Add fetch-style example
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Krems committed Apr 6, 2016
1 parent ca4dbf6 commit 952ac4d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ Finally we can instantiate and make the call:

```js
var github = new Github(config);

// The `fetch`-style:
github.emojis()
.then(function (res) {
return res.json();
})
.done(function (emojiList) {
console.log('Returned %d emojis', Object.keys(emojiList).length);
});

// Using the added convenience of req.json()
github.emojis().json()
.done(function (emojiList) {
console.log('Returned %d emojis', Object.keys(emojiList).length);
Expand Down

0 comments on commit 952ac4d

Please sign in to comment.