Skip to content

Commit

Permalink
fixup! fixup! fixup!: remove courseId and update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xitij2000 committed Dec 3, 2024
1 parent 6cf7dff commit 17027a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/data/hooks.ts
Original file line number Diff line number Diff line change
@@ -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<RootState>(state => state.courseHome.courseId);
4 changes: 2 additions & 2 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -38,7 +38,7 @@ import PageNotFound from './generic/PageNotFound';

subscribe(APP_READY, () => {
ReactDOM.render(
<AppProvider store={initializeStore()}>
<AppProvider store={store}>
<Helmet>
<link rel="shortcut icon" href={getConfig().FAVICON_URL} type="image/x-icon" />
</Helmet>
Expand Down
4 changes: 4 additions & 0 deletions src/store.js → src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ export default function initializeStore() {
}),
});
}

export const store = initializeStore();

export type RootState = ReturnType<typeof store.getState>;

0 comments on commit 17027a6

Please sign in to comment.