hooks/useSCFollowedCategoriesManager
Functions
useSCFollowedCategoriesManager()
useSCFollowedCategoriesManager(
user?
,updateUser?
): {categories
:any
[];emptyCache
:undefined
;follow
:undefined
;isFollowed
:undefined
;isLoading
: (v
) =>boolean
;loading
:any
[];refresh
:undefined
; } | {categories
:any
[];emptyCache
: () =>void
;follow
: (category
) =>Promise
<any
>;isFollowed
: (category
) =>boolean
;isLoading
: (v
) =>boolean
;loading
:any
[];refresh
: () =>void
; }
This custom hook is used to manage the categories followed.
Follow these steps:
1. const scUserContext: SCUserContextType = useSCUser();
2. const scFollowedCategoriesManager: SCFollowedCategoriesManagerType = scUserContext.manager.categories;
3. scFollowedCategoriesManager.isFollowed(category)
Parameters
Parameter | Type |
---|---|
user? | SCUserType |
updateUser? | (info ) => void |
Returns
{ categories
: any
[]; emptyCache
: undefined
; follow
: undefined
; isFollowed
: undefined
; isLoading
: (v
) => boolean
; loading
: any
[]; refresh
: undefined
; } | { categories
: any
[]; emptyCache
: () => void
; follow
: (category
) => Promise
<any
>; isFollowed
: (category
) => boolean
; isLoading
: (v
) => boolean
; loading
: any
[]; refresh
: () => void
; }