import {configureStore, getDefaultMiddleware} from '@reduxjs/toolkit'; import reducer from './rootReducer'; /** * The entry point to our store * getDefaultMiddleware : This returns an array of default middlewares like Thunk (used for async calls) */ const store = configureStore({ reducer, middleware: [...getDefaultMiddleware()], }); /** * The exports below come in handy when dispatching from a file outside of any of the Child component's */ export type AppDispatch = typeof store.dispatch; export type GetState = typeof store.getState; export default store;