import { combineReducers, configureStore } from '@reduxjs/toolkit' import { networkApi, type NetworkApi } from './network' import { shop, auth, user } from './storage' const reducer = combineReducers({ [auth.name]: auth.reducer, [shop.name]: shop.reducer, [user.name]: user.reducer, }) export const store = configureStore({ reducer, middleware: getDefaultMiddleware => getDefaultMiddleware({ thunk: { extraArgument: networkApi, }, }), }) export type RootState = ReturnType export type AppDispatch = typeof store.dispatch export type ThunkApi = { dispatch: AppDispatch state: RootState extra: NetworkApi }