{"action":"created","issue":{"url":"https://api.github.com/repos/ExactTarget/Fuel-Node-REST/issues/53","labels_url":"https://api.github.com/repos/ExactTarget/Fuel-Node-REST/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/ExactTarget/Fuel-Node-REST/issues/53/comments","events_url":"https://api.github.com/repos/ExactTarget/Fuel-Node-REST/issues/53/events","html_url":"https://github.com/ExactTarget/Fuel-Node-REST/pull/53","id":78658819,"number":53,"title":"Implement promises alongside callbacks","user":{"login":"vernak2539","id":521270,"avatar_url":"https://avatars.githubusercontent.com/u/521270?v=3","gravatar_id":"","url":"https://api.github.com/users/vernak2539","html_url":"https://github.com/vernak2539","followers_url":"https://api.github.com/users/vernak2539/followers","following_url":"https://api.github.com/users/vernak2539/following{/other_user}","gists_url":"https://api.github.com/users/vernak2539/gists{/gist_id}","starred_url":"https://api.github.com/users/vernak2539/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vernak2539/subscriptions","organizations_url":"https://api.github.com/users/vernak2539/orgs","repos_url":"https://api.github.com/users/vernak2539/repos","events_url":"https://api.github.com/users/vernak2539/events{/privacy}","received_events_url":"https://api.github.com/users/vernak2539/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-20T19:21:35Z","updated_at":"2015-05-20T19:58:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ExactTarget/Fuel-Node-REST/pulls/53","html_url":"https://github.com/ExactTarget/Fuel-Node-REST/pull/53","diff_url":"https://github.com/ExactTarget/Fuel-Node-REST/pull/53.diff","patch_url":"https://github.com/ExactTarget/Fuel-Node-REST/pull/53.patch"},"body":"- promise integration (non-breaking)\r\n- added tests for all helper functions\r\n- renamed check401header to isValid401 (internal change, not breaking)\r\n- added fallback if respond is given invalid delivery type\r\n- clean up tests a little\r\n- removed all errorPropagatedFrom (people can figure it out)\r\n\r\n```\r\n=============================== Coverage summary ===============================\r\nStatements   : 100% ( 101/101 )\r\nBranches     : 97.78% ( 44/45 )\r\nFunctions    : 100% ( 14/14 )\r\nLines        : 100% ( 101/101 )\r\n================================================================================\r\n```\r\n\r\nfixes #46"},"comment":{"url":"https://api.github.com/repos/ExactTarget/Fuel-Node-REST/issues/comments/104016982","html_url":"https://github.com/ExactTarget/Fuel-Node-REST/pull/53#issuecomment-104016982","issue_url":"https://api.github.com/repos/ExactTarget/Fuel-Node-REST/issues/53","id":104016982,"user":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T19:58:46Z","updated_at":"2015-05-20T19:58:46Z","body":"Gotcha. It's up to you, I was just sharing my opinion :) My concern wasn't performance-related, only what would happen when users did the following\r\n```js\r\nRestClient\r\n    .get(options, function (err, response) {\r\n      // who gets called first, callback or promise?\r\n    })\r\n    .then(function(response) {\r\n        // will be delivered with 200, 400, 401, 500, etc status codes\r\n        // response.body === payload from response\r\n        // response.res === full response from request client\r\n        console.log(response);\r\n    })\r\n    .catch(function(err) {\r\n        // error here\r\n        console.log(err);\r\n    });\r\n}); \r\n```"}}