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