From 427949b96f436766ceb1de4a57f77c67ce267820 Mon Sep 17 00:00:00 2001 From: Caleb Boyd Date: Mon, 13 Apr 2015 16:17:05 -0500 Subject: [PATCH] remove un-needed promise allocations in example --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5d65d6c6..64535125 100644 --- a/README.md +++ b/README.md @@ -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) {