Skip to main content

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; }

info

This custom hook is used to manage the categories followed.

How to use it:

Follow these steps:

1. const scUserContext: SCUserContextType = useSCUser();
2. const scFollowedCategoriesManager: SCFollowedCategoriesManagerType = scUserContext.manager.categories;
3. scFollowedCategoriesManager.isFollowed(category)

Parameters

ParameterType
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; }