What the difference between these configureStore
functions and where has gone initialState
argument?
import { createStore, applyMiddleware } from 'redux';
import logger from 'redux-logger';
import thunk from 'redux-thunk';
import rootReducer from '../reducers';
export default function configureStore(initialState){
const store = createStore(
rootReducer,
initialState,
applyMiddleware(thunk, logger) //list of middlewares in arguments
);
return store;
}
export default function configureStore() {
const store = compose( //composed middlewares
applyMiddleware(thunk),
applyMiddleware(logger)
)(createStore)(rootReducer);
return store;
}