mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor(client): migrate more files to TS (#59202)
This commit is contained in:
committed by
GitHub
parent
83a59e097f
commit
fd0c4dbd05
@@ -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;
|
||||
Reference in New Issue
Block a user