From 097d7ee6d30f91c88135d8398933d1ab72b7534b Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 7 Apr 2016 23:15:53 +1200 Subject: [PATCH] Removed unnecessary thunk wrapper in actions --- admin/javascript/src/boot/index.js | 2 +- admin/javascript/src/state/config/actions.js | 9 ++++----- admin/javascript/src/state/schema/actions.js | 9 ++++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/admin/javascript/src/boot/index.js b/admin/javascript/src/boot/index.js index 89da211d1..ad902b7ab 100644 --- a/admin/javascript/src/boot/index.js +++ b/admin/javascript/src/boot/index.js @@ -26,7 +26,7 @@ function appBoot() { window.store = createStoreWithMiddleware(rootReducer, initialState); // Set the initial config state. - configActions.setConfig(window.ss.config)(window.store.dispatch); + window.store.dispatch(configActions.setConfig(window.ss.config)); } // TODO: This should be using `window.onload` but isn't because diff --git a/admin/javascript/src/state/config/actions.js b/admin/javascript/src/state/config/actions.js index d26139ee4..9c9955638 100644 --- a/admin/javascript/src/state/config/actions.js +++ b/admin/javascript/src/state/config/actions.js @@ -6,9 +6,8 @@ import ACTION_TYPES from './action-types'; * @param object config */ export function setConfig(config) { - return (dispatch) => - dispatch({ - type: ACTION_TYPES.SET_CONFIG, - payload: { config }, - }); + return { + type: ACTION_TYPES.SET_CONFIG, + payload: { config }, + }; } diff --git a/admin/javascript/src/state/schema/actions.js b/admin/javascript/src/state/schema/actions.js index cc6ac4671..f8f6a7a40 100644 --- a/admin/javascript/src/state/schema/actions.js +++ b/admin/javascript/src/state/schema/actions.js @@ -6,9 +6,8 @@ import ACTION_TYPES from './action-types'; * @param string schema - JSON schema for the layout. */ export function setSchema(schema) { - return (dispatch) => - dispatch({ - type: ACTION_TYPES.SET_SCHEMA, - payload: schema, - }); + return { + type: ACTION_TYPES.SET_SCHEMA, + payload: schema, + }; }