Removed unnecessary thunk wrapper in actions

This commit is contained in:
Ingo Schommer 2016-04-07 23:15:53 +12:00
parent f9d5b0db97
commit 097d7ee6d3
3 changed files with 9 additions and 11 deletions

View File

@ -26,7 +26,7 @@ function appBoot() {
window.store = createStoreWithMiddleware(rootReducer, initialState); window.store = createStoreWithMiddleware(rootReducer, initialState);
// Set the initial config state. // 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 // TODO: This should be using `window.onload` but isn't because

View File

@ -6,9 +6,8 @@ import ACTION_TYPES from './action-types';
* @param object config * @param object config
*/ */
export function setConfig(config) { export function setConfig(config) {
return (dispatch) => return {
dispatch({ type: ACTION_TYPES.SET_CONFIG,
type: ACTION_TYPES.SET_CONFIG, payload: { config },
payload: { config }, };
});
} }

View File

@ -6,9 +6,8 @@ import ACTION_TYPES from './action-types';
* @param string schema - JSON schema for the layout. * @param string schema - JSON schema for the layout.
*/ */
export function setSchema(schema) { export function setSchema(schema) {
return (dispatch) => return {
dispatch({ type: ACTION_TYPES.SET_SCHEMA,
type: ACTION_TYPES.SET_SCHEMA, payload: schema,
payload: schema, };
});
} }