refactor(client): migrate more files to TS (#59202)

This commit is contained in:
Oliver Eyton-Williams
2025-03-11 04:43:57 +01:00
committed by GitHub
parent 83a59e097f
commit fd0c4dbd05
5 changed files with 11 additions and 0 deletions
@@ -9,6 +9,12 @@ import rootEpic from './root-epic';
import rootReducer from './root-reducer';
import rootSaga from './root-saga';
declare const module: {
hot?: {
accept: (path: string, callback: () => void) => void;
};
};
const { environment } = envData;
const clientSide = isBrowser();
@@ -46,11 +52,15 @@ export const createStore = (preloadedState = {}) => {
);
}
sagaMiddleware.run(rootSaga);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
epicMiddleware.run(rootEpic);
if (module.hot) {
// Enable Webpack hot module replacement for reducers
module.hot.accept('./root-reducer', () => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-require-imports
const nextRootReducer = require('./root-reducer');
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
store.replaceReducer(nextRootReducer);
});
}
@@ -3,6 +3,7 @@ import { combineEpics } from 'redux-observable';
import { epics as challengeEpics } from '../templates/Challenges/redux';
import { epics as appEpics } from '.';
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const rootEpic = combineEpics(...appEpics, ...challengeEpics);
export default rootEpic;