Skip to content

포스트 조회수 기능 구현 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: temp
Choose a base branch
from
Open

포스트 조회수 기능 구현 #1

wants to merge 1 commit into from

Conversation

hokyunR
Copy link
Owner

@hokyunR hokyunR commented Jun 10, 2022

Copy link
Owner Author

@hokyunR hokyunR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Case B]

},
});

const filledStats = useMemo(() => {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[p3] 해당 로직을 별도의 helper 함수로 추출하여 descriptive한 이름을 부여하면 가독성이 좋을 것 같습니다.

@@ -212,6 +212,10 @@ const PostViewer: React.FC<PostViewerProps> = ({
history.push(`/write?id=${post.id}`);
};

const onOpenStats = () => {
history.push(`/post-stats/${post.id}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React router에서 제공하는 hook을 다시 래핑해서 useRouter 훅을 만든 예시도 있어서 신기해서 가져와보았습니다.

https://usehooks.com/useRouter/

countMap.set(format(new Date(item.day), 'yyyy-MM-dd'), item.count);
});

const lastDate = new Date(items[0].day);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[p5] 일관성 있는 naming rule이 필요할거 같습니다.
lastDate
currentDate

@@ -35,14 +35,16 @@ declare module '*.png' {
}

declare module '*.webp' {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

declare 잘 모릅니다. 설명 가능하신 분 계실까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants