Skip to main content

hooks/useSCSubscribedEventsManager

Functions

useSCSubscribedEventsManager()

useSCSubscribedEventsManager(user?): { emptyCache: undefined; events: any[]; isLoading: (v) => boolean; loading: any[]; refresh: undefined; subscriptionStatus: undefined; toggleEventAttendance: undefined; toggleEventNonattendance: undefined; } | { emptyCache: () => void; events: any[]; isLoading: (v) => boolean; loading: any[]; refresh: () => void; subscriptionStatus: (event?) => string; toggleEventAttendance: (event) => Promise<any>; toggleEventNonattendance: (event) => Promise<any>; }

info

This custom hook is used to manage the events followed.

How to use it:

Follow these steps:

1. const scUserContext: SCUserContextType = useSCUser();
2. const scSubscribedEventsManager: SCSubscribedEventsManagerType = scUserContext.manager.events;
3. scSubscribedEventsManager.isSubscribed(event)

Parameters

ParameterType
user?SCUserType

Returns

{ emptyCache: undefined; events: any[]; isLoading: (v) => boolean; loading: any[]; refresh: undefined; subscriptionStatus: undefined; toggleEventAttendance: undefined; toggleEventNonattendance: undefined; } | { emptyCache: () => void; events: any[]; isLoading: (v) => boolean; loading: any[]; refresh: () => void; subscriptionStatus: (event?) => string; toggleEventAttendance: (event) => Promise<any>; toggleEventNonattendance: (event) => Promise<any>; }