
function reducer(state = {}, action): Record<string, unknown> {
if (action.type === 'CHANGE_NAME') {
return {
...state,
name: action.payload,
};
}
return state;
}
export const store = createStore(
combineReducers({
i18n: i18nReducer,
alert: alertReducer,
portals: portalElementsReducer,
form: formReducer,
tableReducer: tableReducer,
}),
{
i18n: {},
portals: { portalsList: [] },
},
applyMiddleware(i18nMiddleware),
);
declare global {
export type RootState = ReturnType<typeof store.getState>;
}
export const dispatch: Dispatch = store.dispatch;