@selfcommunity/react-core
Version:
React Core Components useful for integrating UI Community components (react-ui).
37 lines (35 loc) • 1.04 kB
TypeScript
import { SCIncubatorType, SCUserType } from '@selfcommunity/types';
/**
:::info
This custom hook is used to manage to manage subscribed incubators.
:::
:::tip How to use it:
Follow these steps:
```jsx
1. const scUserContext: SCUserContextType = useSCUser();
2. const scSubscribedIncubatorsManager: SCSubscribedIncubatorsManagerType = scUserContext.managers.incubators;
3. scSubscribedIncubatorsManager.isSubscribed(incubator)
```
:::
*/
export default function useSCSubscribedIncubatorsManager(user?: SCUserType): {
incubators: any[];
loading: any[];
isLoading: (v: number | {
id: number;
}) => boolean;
subscribe?: undefined;
isSubscribed?: undefined;
refresh?: undefined;
emptyCache?: undefined;
} | {
incubators: any[];
loading: any[];
isLoading: (v: number | {
id: number;
}) => boolean;
subscribe: (incubator: SCIncubatorType) => Promise<any>;
isSubscribed: (incubator: SCIncubatorType) => boolean;
refresh: () => void;
emptyCache: () => void;
};