Files
plaidware-wms-web/src/redux/index.js
Sathishkumar Krishnan 4c2df3fd2c Feat: List roles page (WMS-40) (#55)
* feat: list roles page with api integration
* Update: added dispatch on first load
2022-02-11 22:55:54 +05:30

24 lines
609 B
JavaScript

import { combineReducers } from 'redux';
import { authReducer } from './AuthRedux';
import { warehouseReducer } from './WarehouseRedux';
import { usersReducer } from './UsersRedux';
import { rolesReducer } from './RolesRedux';
// Combine all reducers.
const appReducer = combineReducers({
auth: authReducer,
warehouse: warehouseReducer,
users: usersReducer,
roles: rolesReducer
});
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;