Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce Domain Driven Design refactor of services #921

Merged
merged 5 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/lib/runes.svelte.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { TutorsId } from "$lib/services/connect";
import type { Course, Lo } from "./services/base/lo-types";

export const rune = <T>(initialValue: T) => {
let _rune = $state(initialValue);
return {
get value() {
return _rune;
},
set value(v: T) {
_rune = v;
}
};
};

export const currentLabStepIndex = rune(0);
export const adobeLoaded = rune(false);
export const animationDelay = rune(200);

export const currentLo = rune<Lo | null>(null);
export const currentCourse = rune<Course | null>(null);

export const tutorsId = rune<TutorsId | null>(null);
12 changes: 0 additions & 12 deletions src/lib/runes.ts

This file was deleted.

58 changes: 58 additions & 0 deletions src/lib/services/base/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Re-exports base types, utilities and constants for easier imports
* @module
*/

// Type exports from lo-types
export type {
Lo,
Course,
Topic,
Lab,
LabStep,
Talk,
Note,
Web,
Github,
Archive,
PanelNote,
PanelTalk,
PanelVideo,
Panels,
Units,
Composite,
Unit,
Side,
Calendar,
WeekType,
VideoIdentifier,
VideoIdentifiers,
LearningResource,
Properties,
IconType,
LearningRecord,
LoType
} from "./lo-types";

// Utility functions from lo-types
export {
imageTypes,
assetTypes,
isCompositeLo
} from "./lo-types";

// Supabase client and utilities
export {
supabase,
getNumOfLearningRecordsIncrements,
getCalendarDuration,
getCalendarCount,
getDurationTotal,
insertOrUpdateCalendar,
handleInteractionData,
storeStudentCourseLearningObjectInSupabase,
updateLearningRecordsDuration,
addOrUpdateStudent,
formatDate,
updateCalendarDuration
} from "./utils/supabase-client";
Loading
Loading