From b785d27241e9f22dcb6a880414500ce8f9e67eb3 Mon Sep 17 00:00:00 2001 From: vera-liu Date: Wed, 12 Oct 2016 15:54:51 -0700 Subject: [PATCH] Taking out object spread operator (#1311) * Changed eslint channel in codeclimate.yml for object spread * Revert "Changed eslint channel in codeclimate.yml for object spread" This reverts commit b9deb8ce84478f9c8f48ca7d41662e7222f40376. * Took out the object spread operator --- .../explorev2/reducers/exploreReducer.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/caravel/assets/javascripts/explorev2/reducers/exploreReducer.js b/caravel/assets/javascripts/explorev2/reducers/exploreReducer.js index 8e397c7e52dc..8ff9b361cb68 100644 --- a/caravel/assets/javascripts/explorev2/reducers/exploreReducer.js +++ b/caravel/assets/javascripts/explorev2/reducers/exploreReducer.js @@ -11,10 +11,11 @@ const setFormInViz = function (state, action) { const setVizInState = function (state, action) { switch (action.type) { case actions.SET_FORM_DATA: - return { - ...state, - formData: setFormInViz(state.formData, action), - }; + return Object.assign( + {}, + state, + { formData: setFormInViz(state.formData, action) } + ); default: return state; } @@ -74,10 +75,11 @@ export const exploreReducer = function (state, action) { return Object.assign({}, state, { datasourceType: action.datasourceType }); }, [actions.SET_FORM_DATA]() { - return { - ...state, - viz: setVizInState(state.viz, action), - }; + return Object.assign( + {}, + state, + { viz: setVizInState(state.viz, action) } + ); }, }; if (action.type in actionHandlers) {