diff --git a/src/data/hooks.ts b/src/data/hooks.ts index 00a71d8dd4..f8ad29bed8 100644 --- a/src/data/hooks.ts +++ b/src/data/hooks.ts @@ -1,4 +1,5 @@ import { useSelector } from 'react-redux'; +import { RootState } from '../store'; // eslint-disable-next-line import/prefer-default-export -export const useContextId = () => useSelector(state => state.courseHome.courseId); +export const useContextId = () => useSelector(state => state.courseHome.courseId); diff --git a/src/index.jsx b/src/index.jsx index af7a153096..76e4eed375 100755 --- a/src/index.jsx +++ b/src/index.jsx @@ -26,7 +26,7 @@ import { TabContainer } from './tab-page'; import { fetchDatesTab, fetchOutlineTab, fetchProgressTab } from './course-home/data'; import { fetchCourse } from './courseware/data'; -import initializeStore from './store'; +import { store } from './store'; import NoticesProvider from './generic/notices'; import PathFixesProvider from './generic/path-fixes'; import LiveTab from './course-home/live-tab/LiveTab'; @@ -38,7 +38,7 @@ import PageNotFound from './generic/PageNotFound'; subscribe(APP_READY, () => { ReactDOM.render( - + diff --git a/src/store.js b/src/store.ts similarity index 92% rename from src/store.js rename to src/store.ts index 9343b0d24a..32a77cdafe 100644 --- a/src/store.js +++ b/src/store.ts @@ -29,3 +29,7 @@ export default function initializeStore() { }), }); } + +export const store = initializeStore(); + +export type RootState = ReturnType;