UNPKG

@replyke/core

Version:

Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.

23 lines (22 loc) 990 B
import { Comment as CommentType } from "../../interfaces/models/Comment"; import { CommentsSortByOptions } from "../../interfaces/CommentsSortByOptions"; import { EntityCommentsTree } from "../../interfaces/EntityCommentsTree"; export interface UseEntityCommentsDataProps { entityId: string | undefined | null; limit?: number; defaultSortBy?: CommentsSortByOptions; } export interface UseEntityCommentsDataValues { entityCommentsTree: EntityCommentsTree; comments: CommentType[]; newComments: CommentType[]; loading: boolean; hasMore: boolean; sortBy: CommentsSortByOptions | null; setSortBy: (newSortBy: CommentsSortByOptions) => void; loadMore: () => void; addCommentsToTree: (newComments: CommentType[] | undefined, newlyAdded?: boolean) => void; removeCommentFromTree: (commentId: string) => void; } declare function useEntityComments(props: UseEntityCommentsDataProps): UseEntityCommentsDataValues; export default useEntityComments;