* #708 apply strictier linting rules and fix simple eslint bugs * #708 fix eslint errors relate to promise * #708 fix eslint import/no-extraneous-dependencies * #708 fix eslint errors of react-hook * #708 enable eslint check for typescript --------- Co-authored-by: lethemanh <lethemanh@lethemanhs-MacBook-Pro.local>
This commit is contained in:
+20
-20
@@ -1,14 +1,14 @@
|
||||
import eventsCalendar from "@/features/Calendars/CalendarSlice";
|
||||
import searchResultReducer from "@/features/Search/SearchSlice";
|
||||
import settingsReducer from "@/features/Settings/SettingsSlice";
|
||||
import userReducer from "@/features/User/userSlice";
|
||||
import { combineReducers, configureStore } from "@reduxjs/toolkit";
|
||||
import loadingReducer from "./loadingSlice";
|
||||
import { createBrowserHistory } from "history";
|
||||
import { createReduxHistoryContext } from "redux-first-history";
|
||||
import eventsCalendar from '@/features/Calendars/CalendarSlice'
|
||||
import searchResultReducer from '@/features/Search/SearchSlice'
|
||||
import settingsReducer from '@/features/Settings/SettingsSlice'
|
||||
import userReducer from '@/features/User/userSlice'
|
||||
import { combineReducers, configureStore } from '@reduxjs/toolkit'
|
||||
import loadingReducer from './loadingSlice'
|
||||
import { createBrowserHistory } from 'history'
|
||||
import { createReduxHistoryContext } from 'redux-first-history'
|
||||
|
||||
const { createReduxHistory, routerMiddleware, routerReducer } =
|
||||
createReduxHistoryContext({ history: createBrowserHistory() });
|
||||
createReduxHistoryContext({ history: createBrowserHistory() })
|
||||
|
||||
const rootReducer = combineReducers({
|
||||
router: routerReducer,
|
||||
@@ -16,22 +16,22 @@ const rootReducer = combineReducers({
|
||||
calendars: eventsCalendar,
|
||||
settings: settingsReducer,
|
||||
searchResult: searchResultReducer,
|
||||
loading: loadingReducer,
|
||||
});
|
||||
loading: loadingReducer
|
||||
})
|
||||
|
||||
export const setupStore = (preloadedState?: Partial<RootState>) => {
|
||||
return configureStore({
|
||||
reducer: rootReducer,
|
||||
preloadedState,
|
||||
middleware: (getDefaultMiddleware) =>
|
||||
getDefaultMiddleware().concat(routerMiddleware),
|
||||
});
|
||||
};
|
||||
middleware: getDefaultMiddleware =>
|
||||
getDefaultMiddleware().concat(routerMiddleware)
|
||||
})
|
||||
}
|
||||
|
||||
export const store = setupStore();
|
||||
export const store = setupStore()
|
||||
|
||||
export const history = createReduxHistory(store);
|
||||
export const history = createReduxHistory(store)
|
||||
|
||||
export type RootState = ReturnType<typeof rootReducer>;
|
||||
export type AppStore = ReturnType<typeof setupStore>;
|
||||
export type AppDispatch = AppStore["dispatch"];
|
||||
export type RootState = ReturnType<typeof rootReducer>
|
||||
export type AppStore = ReturnType<typeof setupStore>
|
||||
export type AppDispatch = AppStore['dispatch']
|
||||
|
||||
Reference in New Issue
Block a user