Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { createStore, applyMiddleware } from 'redux';
- import thunk from 'redux-thunk';
- import rootReducer from '../reducers/Index';
- import axios from 'axios';
- const API = 'http://localhost:3000/';
- const createStoreWithMiddleware = applyMiddleware(thunk)(createStore);
- const store = createStoreWithMiddleware(rootReducer);
- export function getInfo() {
- return axios.get(`${API}/api/get_user_id`).then((data) => createStoreWithMiddleware(rootReducer, { statusBar: data.data }));
- };
- getInfo();
- console.log(store.getState());
- export default store;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement