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>; }
This custom hook is used to manage the events followed.
Follow these steps:
1. const scUserContext: SCUserContextType = useSCUser();
2. const scSubscribedEventsManager: SCSubscribedEventsManagerType = scUserContext.manager.events;
3. scSubscribedEventsManager.isSubscribed(event)
Parameters
| Parameter | Type |
|---|---|
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>; }