index.js 439 B

1234567891011
  1. import {applyMiddleware, createStore} from "redux";
  2. import thunk from "redux-thunk";
  3. import {rootReducer} from "./CombineReducers";
  4. import {actionFullUserFindOne} from "../actions/ActionUserFind";
  5. export const store = createStore(rootReducer, applyMiddleware(thunk))
  6. if (localStorage.authToken && localStorage.userId){
  7. store.dispatch(actionFullUserFindOne(localStorage.userId))
  8. }
  9. store.subscribe(() => console.log(store.getState()))