MCPcopy Create free account
hub / github.com/dailydotdev/apps / useReadArticle

Function useReadArticle

packages/shared/src/hooks/usePostContent.ts:39–53  ·  view source on GitHub ↗
({
  post,
  origin,
}: UseReadArticle)

Source from the content-addressed store, hash-verified

37}
38
39export const useReadArticle = ({
40 post,
41 origin,
42}: UseReadArticle): EmptyPromise => {
43 const onPostClick = useOnPostClick({ origin });
44
45 return useCallback(() => {
46 const { target, parentId } = getPostReadTarget(post);
47
48 return onPostClick({
49 post: target || post,
50 optional: { parent_id: parentId },
51 });
52 }, [onPostClick, post]);
53};
54
55const usePostContent = ({
56 origin,

Callers 4

PostModerationModalFunction · 0.90
ReaderPostLayoutFunction · 0.90
ReaderFallback.tsxFile · 0.90
usePostContentFunction · 0.85

Calls 2

getPostReadTargetFunction · 0.90
useOnPostClickFunction · 0.85

Tested by

no test coverage detected