Skip to content

Commit

Permalink
Remove unnecessary rootReducer creator
Browse files Browse the repository at this point in the history
  • Loading branch information
RichDom2185 committed May 1, 2024
1 parent 323de07 commit 6b35854
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions src/commons/application/reducers/RootReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ import { StoriesReducer as stories } from '../../../features/stories/StoriesRedu
import { FileSystemReducer as fileSystem } from '../../fileSystem/FileSystemReducer';
import { SideContentReducer as sideContent } from '../../sideContent/SideContentReducer';
import { WorkspaceReducer as workspaces } from '../../workspace/WorkspaceReducer';
import { OverallState } from '../ApplicationTypes';
import { RouterReducer as router } from './CommonsReducer';
import { SessionsReducer as session } from './SessionsReducer';

const createRootReducer = () =>
combineReducers({
router,
achievement,
dashboard,
playground,
session,
stories,
workspaces,
fileSystem,
sideContent
});
const rootReducer = combineReducers<OverallState>({
router,
achievement,
dashboard,
playground,
session,
stories,
workspaces,
fileSystem,
sideContent
});

export default createRootReducer;
export default rootReducer;
4 changes: 2 additions & 2 deletions src/pages/createStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import createSagaMiddleware from 'redux-saga';
import { SourceActionType } from 'src/commons/utils/ActionsHelper';

import { defaultState, OverallState } from '../commons/application/ApplicationTypes';
import createRootReducer from '../commons/application/reducers/RootReducer';
import rootReducer from '../commons/application/reducers/RootReducer';
import MainSaga from '../commons/sagas/MainSaga';
import { generateOctokitInstance } from '../commons/utils/GitHubPersistenceHelper';
import { loadStoredState, SavedState, saveState } from './localStorage';
Expand All @@ -21,7 +21,7 @@ export function createStore() {
const initialStore = loadStore(loadStoredState()) || defaultState;

const createdStore = configureStore<OverallState, SourceActionType>({
reducer: createRootReducer(),
reducer: rootReducer,
// Fix for redux-saga type incompatibility
// See: https://github.com/reduxjs/redux-toolkit/issues/3950
middleware: middleware as any,
Expand Down

0 comments on commit 6b35854

Please sign in to comment.