Skip to main content

hooks/useSCSubscribedGroupsManager

Functions

useSCSubscribedGroupsManager()

useSCSubscribedGroupsManager(user?): { emptyCache: undefined; groups: any[]; isLoading: (v) => boolean; loading: any[]; refresh: undefined; subscribe: undefined; subscriptionStatus: undefined; unsubscribe: undefined; } | { emptyCache: () => void; groups: any[]; isLoading: (v) => boolean; loading: any[]; refresh: () => void; subscribe: (group, userId?) => Promise<any>; subscriptionStatus: (group) => string; unsubscribe: (group) => Promise<any>; }

info

This custom hook is used to manage the groups followed.

How to use it:

Follow these steps:

1. const scUserContext: SCUserContextType = useSCUser();
2. const scSubscribedGroupsManager: SCSubscribedGroupsManagerType = scUserContext.manager.groups;
3. scSubscribedGroupsManager.isSubscribed(group)

Parameters

ParameterType
user?SCUserType

Returns

{ emptyCache: undefined; groups: any[]; isLoading: (v) => boolean; loading: any[]; refresh: undefined; subscribe: undefined; subscriptionStatus: undefined; unsubscribe: undefined; } | { emptyCache: () => void; groups: any[]; isLoading: (v) => boolean; loading: any[]; refresh: () => void; subscribe: (group, userId?) => Promise<any>; subscriptionStatus: (group) => string; unsubscribe: (group) => Promise<any>; }