Skip to content

Commit

Permalink
remove un-needed promise allocations in example
Browse files Browse the repository at this point in the history
  • Loading branch information
calebboyd committed Apr 13, 2015
1 parent 654c94f commit 427949b
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 427949b

Please sign in to comment.