From 60d0029583b82f01640847a28921308f785b39aa Mon Sep 17 00:00:00 2001 From: Thomas Hudspith-Tatham Date: Sun, 8 Nov 2015 20:01:34 +0000 Subject: [PATCH 1/2] defaulting resolved to an empty object in case the promise resolves non existy values --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 4cf01f50..552331f2 100644 --- a/src/index.js +++ b/src/index.js @@ -29,7 +29,7 @@ export default function promiseMiddleware(config={}) { * action object. */ return promise.then( - resolved => next({ // eslint-disable-line no-shadow + (resolved={}) => next({ // eslint-disable-line no-shadow type: `${type}_${FULFILLED}`, ...resolved.meta || resolved.payload ? resolved : { ...resolved && { payload: resolved }, From 3450c0d6384efe3ab672358329e43fdec69f4ace Mon Sep 17 00:00:00 2001 From: Thomas Hudspith-Tatham Date: Sun, 8 Nov 2015 20:05:14 +0000 Subject: [PATCH 2/2] removed eslint disabling as no longer needed --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 552331f2..d7f3afcf 100644 --- a/src/index.js +++ b/src/index.js @@ -29,7 +29,7 @@ export default function promiseMiddleware(config={}) { * action object. */ return promise.then( - (resolved={}) => next({ // eslint-disable-line no-shadow + (resolved={}) => next({ type: `${type}_${FULFILLED}`, ...resolved.meta || resolved.payload ? resolved : { ...resolved && { payload: resolved },