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);
// 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

View File

@ -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 },
};
}

View File

@ -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,
};
}