Skip to content

Commit

Permalink
Merge pull request JakeChampion#120 from calebboyd/patch-1
Browse files Browse the repository at this point in the history
remove un-needed promise allocations in example
  • Loading branch information
josh committed Apr 13, 2015
2 parents 654c94f + 427949b commit 9d08342
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ resolved only on successful, 200 level, status codes.
```javascript
function status(response) {
if (response.status >= 200 && response.status < 300) {
return Promise.resolve(response)
} else {
return Promise.reject(new Error(response.statusText))
return response
}
throw new Error(response.statusText)
}

function json(response) {
Expand Down

0 comments on commit 9d08342

Please sign in to comment.