refactoring courseschedule storage
This commit is contained in:
@@ -10,9 +10,9 @@ interface IOptionsStore {
|
||||
shouldScrollToLoad: boolean;
|
||||
}
|
||||
|
||||
export const optionsStore = createSyncStore<IOptionsStore>({
|
||||
export const OptionsStore = createSyncStore<IOptionsStore>({
|
||||
shouldHighlightConflicts: true,
|
||||
shouldScrollToLoad: true,
|
||||
});
|
||||
|
||||
debugStore({ optionsStore });
|
||||
debugStore({ OptionsStore });
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
import { createLocalStore, debugStore } from 'chrome-extension-toolkit';
|
||||
import { UserSchedule } from 'src/shared/types/UserSchedule';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
interface IUserScheduleStore {
|
||||
schedules: UserSchedule[];
|
||||
activeIndex: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A store that is used for storing user schedules (and the active schedule)
|
||||
*/
|
||||
export const userScheduleStore = createLocalStore<IUserScheduleStore>({
|
||||
export const UserScheduleStore = createLocalStore<IUserScheduleStore>({
|
||||
schedules: [
|
||||
new UserSchedule({
|
||||
courses: [],
|
||||
id: uuidv4(),
|
||||
name: 'Schedule 1',
|
||||
creditHours: 0,
|
||||
}),
|
||||
],
|
||||
activeIndex: 0,
|
||||
});
|
||||
|
||||
debugStore({ userScheduleStore });
|
||||
debugStore({ userScheduleStore: UserScheduleStore });
|
||||
|
||||
Reference in New Issue
Block a user