How to clear redux store for React-admin?

Viewed 62

I want to clear react admin redux store while logging out from the application. How can i do that?

Is there a way to access redux store of react admin, like I have to access resource dashboard which has all the potential data (like userID, homeId etc). I need to send this data with the payload, of another API request while I'm on some other page/resource. How can i do that?

1 Answers

I think this approach is better.

const rootReducer = combineReducers({
    auth: authReducer,
    ...formReducers,
    routing
});


export default (state, action) =>
  rootReducer(action.type === 'USER_LOGOUT' ? undefined : state, action);
Related