@selfcommunity/react-core
Version:
React Core Components useful for integrating UI Community components (react-ui).
50 lines (49 loc) • 1.42 kB
TypeScript
import { SCCommentsOrderBy, SCCommentType, SCContributionType, SCFeedObjectType } from '@selfcommunity/types';
import { CacheStrategies } from '@selfcommunity/utils';
/**
* Interface SCCommentsObjectType
*/
export interface SCCommentsObjectType {
componentLoaded: boolean;
comments: SCCommentType[];
total: number;
next: string;
previous: string;
isLoadingNext: boolean;
isLoadingPrevious: boolean;
page: number;
reload: boolean;
}
/**
* @hidden
* We have complex state logic that involves multiple sub-values,
* so useReducer is preferable to useState.
* Define all possible auth action types label
* Use this to export actions and dispatch an action
*/
export declare const commentsObjectActionTypes: {
LOADING_NEXT: string;
LOADING_PREVIOUS: string;
DATA_NEXT_LOADED: string;
DATA_PREVIOUS_LOADED: string;
DATA_RELOAD: string;
DATA_RELOADED: string;
DATA_REVALIDATE: string;
};
/**
:::info
This custom hooks is used to fetch paginated comments.
:::
* @param props
*/
export default function useSCFetchCommentObjects(props: {
id?: number;
feedObject?: SCFeedObjectType;
feedObjectType: Exclude<SCContributionType, SCContributionType.COMMENT>;
offset?: number;
pageSize?: number;
orderBy?: SCCommentsOrderBy;
parent?: number;
onChangePage?: (page: any) => any;
cacheStrategy?: CacheStrategies;
}): any;