From 952ac4d63fc7e4c3a8b902edd0044a5d71e45712 Mon Sep 17 00:00:00 2001 From: Jan Krems Date: Wed, 6 Apr 2016 11:04:52 -0700 Subject: [PATCH] docs: Add fetch-style example --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 20b2883..8e662be 100644 --- a/README.md +++ b/README.md @@ -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);