24 lines
637 B
TypeScript
24 lines
637 B
TypeScript
|
import { configureStore } from "@reduxjs/toolkit";
|
||
|
import { setupListeners } from "@reduxjs/toolkit/query/react";
|
||
|
import { mercuryApi } from "./api";
|
||
|
import { accounts } from "./accounts";
|
||
|
import { blogs } from "./blogs";
|
||
|
import { posts } from "./posts";
|
||
|
|
||
|
const store = configureStore({
|
||
|
reducer: {
|
||
|
accounts,
|
||
|
blogs,
|
||
|
posts,
|
||
|
[mercuryApi.reducerPath]: mercuryApi.reducer,
|
||
|
},
|
||
|
middleware: (getDefaultMiddleware) =>
|
||
|
getDefaultMiddleware().concat(mercuryApi.middleware),
|
||
|
});
|
||
|
|
||
|
setupListeners(store.dispatch);
|
||
|
|
||
|
export default store;
|
||
|
export type Store = ReturnType<typeof store.getState>;
|
||
|
export type Dispatch = typeof store.dispatch;
|