React beginner here, learning by coding, need some help/advice to convert this Redux store to Redux toolkit, here i'm using function called configureStore, what is good way of changing this into using the 'configureStore' which comes from '@reduxjs/toolkit' this is for learning purpose that 'createRootReducer' comes from my reducers.js which combines
const createRootReducer = (history) => combineReducers({
articles: articlesReducer,
selection: selectionReducer,
});
would appreciate any help/advice. my store.js:
import { createBrowserHistory } from "history";
import { createStore, compose, applyMiddleware } from "redux";
import thunk from "redux-thunk";
import { routerMiddleware } from "connected-react-router";
import createRootReducer from "./reducers";
export const history = createBrowserHistory();
const storeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
export default function configureStore(preloadedState) {
const store = createStore(
createRootReducer(history),
preloadedState,
storeEnhancers(applyMiddleware(routerMiddleware(history), thunk))
);
return store;
}