displaying bar graph, fetching distributions message
This commit is contained in:
@@ -9,6 +9,7 @@ import { SessionStore } from './storage/SessionStore';
|
||||
import browserActionHandler from './handler/browserActionHandler';
|
||||
import hotReloadingHandler from './handler/hotReloadingHandler';
|
||||
import tabManagementHandler from './handler/tabManagementHandler';
|
||||
import courseDataHandler from './handler/courseDataHandler';
|
||||
|
||||
onServiceWorkerAlive();
|
||||
|
||||
@@ -34,6 +35,7 @@ const messageListener = new MessageListener<BACKGROUND_MESSAGES>({
|
||||
...browserActionHandler,
|
||||
...hotReloadingHandler,
|
||||
...tabManagementHandler,
|
||||
...courseDataHandler,
|
||||
});
|
||||
|
||||
messageListener.listen();
|
||||
|
||||
14
src/background/handler/courseDataHandler.ts
Normal file
14
src/background/handler/courseDataHandler.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { MessageHandler } from 'chrome-extension-toolkit';
|
||||
import CourseDataMessages from 'src/shared/messages/CourseDataMessages';
|
||||
|
||||
const courseDataHandler: MessageHandler<CourseDataMessages> = {
|
||||
getDistribution({ data, sendResponse }) {
|
||||
const { course } = data;
|
||||
|
||||
const dummyData = Array.from({ length: 18 }, () => Math.floor(Math.random() * 100));
|
||||
|
||||
sendResponse(dummyData);
|
||||
},
|
||||
};
|
||||
|
||||
export default courseDataHandler;
|
||||
Reference in New Issue
Block a user