From a81d2a67475c1125c132ea321e9ae33d4071d81c Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Sat, 17 Sep 2016 00:52:18 -0400 Subject: [PATCH] Throw the error There's no need to return a Rejected Promise inside a `#then` block. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 2ecf558..b3f0028 100644 --- a/src/index.js +++ b/src/index.js @@ -17,7 +17,7 @@ export default function promiseMiddleware({ dispatch }) { result => dispatch({ ...action, payload: result }), error => { dispatch({ ...action, payload: error, error: true }); - return Promise.reject(error); + throw error; } ) : next(action);