text: import { useMemo } from "react";
  import { createStore, applyMiddleware } from "redux";
  import { composeWithDevTools } from "redux-devtools-extension";
  import thunk from "redux-thunk";
  import { persistStore, persistReducer } from "redux-persist"; // imports from redux-persist
  // import storage from "redux-persist/lib/storage"; // defaults to localStorage for web
  import storage from "../storage";
  import rootReducer from "./reducers";
  const middleware = [thunk];
  const persistConfig = {
    key: "root",
    storage,
  };
  
  const persistedReducer = persistReducer(persistConfig, rootReducer);
  
  export default () => {
    let store = createStore(
      persistedReducer,
      applyMiddleware(...middleware),
      window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
    );
    let persistor = persistStore(store);
    return { store, persistor };
  };
  