/
lanre
/
notes
Обзор
Документация
Войти
/
lanre
/
notes
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
client/src/stores/rootStore.ts
24 строки
763 B
lanre
complete server
25 мар 2024, 01:47
25 мар 2024, 01:47
5a92d84
Код
Авторство
О чём код?
import { combineReducers } from 'redux'; import authReducer from './authStore'; import noteReducer from './noteStore'; import {thunk} from 'redux-thunk'; import { configureStore, Middleware } from '@reduxjs/toolkit'; import { ThunkAction, Action } from '@reduxjs/toolkit'; const rootReducer = combineReducers({ auth: authReducer, note: noteReducer }); const middleware: Middleware[] = [thunk as any]; const store = configureStore({ reducer: rootReducer, middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(middleware), }); export type RootState = ReturnType<typeof store.getState> export type AppDispatch = typeof store.dispatch export type AppThunk = ThunkAction<void, RootState, null, Action<string>>; export default store;