@selfcommunity/react-core
Version:
React Core Components useful for integrating UI Community components (react-ui).
39 lines (37 loc) • 1.13 kB
TypeScript
import { SCEventType, SCUserType } from '@selfcommunity/types';
/**
:::info
This custom hook is used to manage the events followed.
:::
:::tip How to use it:
Follow these steps:
```jsx
1. const scUserContext: SCUserContextType = useSCUser();
2. const scSubscribedEventsManager: SCSubscribedEventsManagerType = scUserContext.manager.events;
3. scSubscribedEventsManager.isSubscribed(event)
```
:::
*/
export default function useSCSubscribedEventsManager(user?: SCUserType): {
events: any[];
loading: any[];
isLoading: (v: number | {
id: number;
}) => boolean;
toggleEventAttendance?: undefined;
toggleEventNonattendance?: undefined;
subscriptionStatus?: undefined;
refresh?: undefined;
emptyCache?: undefined;
} | {
events: any[];
loading: any[];
isLoading: (v: number | {
id: number;
}) => boolean;
toggleEventAttendance: (event: SCEventType) => Promise<any>;
toggleEventNonattendance: (event: SCEventType) => Promise<any>;
subscriptionStatus: (event?: SCEventType) => string;
refresh: () => void;
emptyCache: () => void;
};