Files
plaidware-wms-web/src/redux/index.js
2022-02-02 14:45:41 +05:30

20 lines
473 B
JavaScript

import { combineReducers } from 'redux';
import { authReducer } from './AuthRedux';
import { warehouseReducer } from './WarehouseRedux';
// Combine all reducers.
const appReducer = combineReducers({
auth: authReducer,
warehouse: warehouseReducer
});
const rootReducer = (state, action) => {
// Clear all data in redux store to initial.
if (action.type === 'LOGOUT') {
state = undefined;
}
return appReducer(state, action);
};
export default rootReducer;