Skip to content

[FEAT] 경기 리스트 무한 스크롤 구현 #96

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

Merged
merged 5 commits into from
Nov 28, 2023

Conversation

seongminn
Copy link
Member

🌍 이슈 번호

✅ 작업 내용

  • 경기 리스트 무한 스크롤 구현
  • 쿼리스트링을 상수로 관리(sports_id, status, league_id)

@seongminn seongminn added the FEAT 새로운 기능 추가 label Nov 28, 2023
@seongminn seongminn requested a review from HiimKwak November 28, 2023 08:00
@seongminn seongminn self-assigned this Nov 28, 2023
@seongminn seongminn changed the title Feat/main match list infinite scroll [FEAT] 경기 리스트 무한 스크롤 구현 Nov 28, 2023
src/app/page.tsx Outdated
className="text-gary-5 rounded-xl px-5 py-3"
onClick={() => setInParams(QUERY_PARAMS.status, 'finished')}
className={$(
'text-gary-5 rounded-xl px-5 py-3',
Copy link
Contributor

Choose a reason for hiding this comment

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

text-gray-5 오타 있습니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

헉 그러네요! 반영하겠습니다. 👍

return { params, appendToParams, setInParams };
type StoreWithStatus<T> = T & { status: MatchStatus };

const repeatIterator = <T extends { [key: string]: string | string[] }>(
Copy link
Contributor

Choose a reason for hiding this comment

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

이 함수는 어떤 기능을 수행하는 함수인가요? 잘 이해가 안돼서 설명 부탁드립니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

query params의 값들을 객체로 바꾸기 위해 생성한 함수입니다. URLSearchParams.entries 메서드는 이터러블 객체를 반환하는데, 이터러블을 순회하면서 순회할 값이 남아있다면 재귀 호출하여 다음 값을 읽어올 수 있게 하고, 순회할 값이 남아 있지 않다면 순회한 값을 넘겨 받은 객체에 저장하여 반환합니다.

이터러블은 done, value 프로퍼티를 갖고 있습니다.
https://poiemaweb.com/es6-iteration-for-of

@seongminn seongminn force-pushed the feat/main-match-list-infinite-scroll branch from 6ba2c34 to 90496b4 Compare November 28, 2023 13:06
@HiimKwak
Copy link
Contributor

고생하셨습니다! satisfies란 연산자도 있는지 처음 알았네요 많이 배워갑니다🫡

Base automatically changed from feat/comment to main November 28, 2023 13:17
@seongminn seongminn merged commit f950673 into main Nov 28, 2023
@seongminn seongminn deleted the feat/main-match-list-infinite-scroll branch November 28, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEAT 새로운 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants