You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailchat/client/shared/redux/store.ts

26 lines
677 B
TypeScript

import { configureStore } from '@reduxjs/toolkit';
import { appReducer } from './slices';
function createStore() {
const store = configureStore({
reducer: appReducer,
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
serializableCheck: false,
}),
devTools: process.env.NODE_ENV !== 'production',
});
return store;
}
const reduxStore = createStore();
export function getReduxStore() {
return reduxStore;
}
export type AppStore = ReturnType<typeof createStore>;
export type AppState = ReturnType<AppStore['getState']>;
export type AppDispatch = AppStore['dispatch'];
export { Provider as ReduxProvider } from 'react-redux';