From 17027a6207382a5ff8dbc66660b68f31355e3f89 Mon Sep 17 00:00:00 2001 From: "kshitij.sobti" Date: Tue, 3 Dec 2024 17:49:14 +0530 Subject: [PATCH] fixup! fixup! fixup!: remove courseId and update docs --- src/data/hooks.ts | 3 ++- src/index.jsx | 4 ++-- src/{store.js => store.ts} | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) rename src/{store.js => store.ts} (92%) 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;