UNPKG

@selfcommunity/react-core

Version:

React Core Components useful for integrating UI Community components (react-ui).

23 lines (22 loc) 776 B
import { CacheStrategies } from '@selfcommunity/utils'; import { SCContributionType, SCFeedDiscussionType, SCFeedObjectType, SCFeedPostType } from '@selfcommunity/types'; /** :::info This custom hook is used to fetch a feed object. ::: * @param object * @param object.id * @param object.feedObject * @param object.feedObjectType * @param object.cacheStrategy */ export default function useSCFetchFeedObject({ id, feedObject, feedObjectType, cacheStrategy, }: { id?: number | string; feedObject?: SCFeedObjectType; feedObjectType?: Exclude<SCContributionType, SCContributionType.COMMENT>; cacheStrategy?: CacheStrategies; }): { obj: SCFeedObjectType | SCFeedDiscussionType | SCFeedPostType; setObj: (newObj: any) => void; error: string; };