import { combineReducers } from '@reduxjs/toolkit'; import { persistReducer } from 'redux-persist'; import storage from 'redux-persist/lib/storage'; import reducerMessages from '../messages/reducer' import reducerPinnedMessages from '../pinnedMessages/reducer'; import reducerAllMessages from '../allMessages/reducer' import reducerContacts from '../contacts/reducer' import reducerChat from '../chat/reducer' import reducerChats from '../chats/reducer' import reducerControl from '../control/reducer' import reducerAuthorization from '../authorization/reducer'; const authorizationPersistConfig = { key: 'auth', storage: storage, }; export const rootReducer = combineReducers({ messages: reducerMessages, pinnedMessages: reducerPinnedMessages, allMessages: reducerAllMessages, chat:reducerChat, chats: reducerChats, contacts:reducerContacts, control: reducerControl, authorization: persistReducer( authorizationPersistConfig, reducerAuthorization, ), });