Skip to main content

hooks/useSCJoinedCoursesManager

Functions

useSCJoinedCoursesManager()

useSCJoinedCoursesManager(user?): { courses: any[]; emptyCache: undefined; isLoading: (v) => boolean; join: undefined; joinStatus: undefined; leave: undefined; loading: any[]; refresh: undefined; } | { courses: any[]; emptyCache: () => void; isLoading: (v) => boolean; join: (course, userId?) => Promise<any>; joinStatus: (course) => string; leave: (course) => Promise<any>; loading: any[]; refresh: () => void; }

info

This custom hook is used to manage the courses followed.

How to use it:

Follow these steps:

1. const scUserContext: SCUserContextType = useSCUser();
2. const scJoinedCoursesManager: SCJoinedCoursesManagerType = scUserContext.manager.courses;
3. scJoinedCoursesManager.isJoined(course)

Parameters

ParameterType
user?SCUserType

Returns

{ courses: any[]; emptyCache: undefined; isLoading: (v) => boolean; join: undefined; joinStatus: undefined; leave: undefined; loading: any[]; refresh: undefined; } | { courses: any[]; emptyCache: () => void; isLoading: (v) => boolean; join: (course, userId?) => Promise<any>; joinStatus: (course) => string; leave: (course) => Promise<any>; loading: any[]; refresh: () => void; }