Skip to content

Commit

Permalink
Merge pull request #921 from tutors-sdk/development
Browse files Browse the repository at this point in the history
introduce Domain Driven Design refactor of services
  • Loading branch information
edeleastar authored Jan 9, 2025
2 parents 639d7c7 + ee0c918 commit 7c1e72d
Show file tree
Hide file tree
Showing 111 changed files with 1,018 additions and 824 deletions.
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

0 comments on commit 7c1e72d

Please sign in to comment.