Skip to content
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

[MyPage] React-Query 베이스 설정 및 내 기록 페이지 백엔드 연동 #12

Open
Bokdol11859 opened this issue Jan 24, 2023 · 0 comments
Assignees
Labels
개선 기능의 변경 없이 개선 위한 이슈 기능 구현 완료 리팩토링이 끝난 이슈

Comments

@Bokdol11859
Copy link
Owner

Bokdol11859 commented Jan 24, 2023

리팩토링 이전에 클래스의 상태를 구분하기 위해 짰던 코드
image

checkFail에 부합하는지 안하는지에 따라서 success/ongoing을 주먹구구식으로 구분을 했었습니다.
그에 따라 CBT 운영 당시 실패하지 않은 클래스임에도 불구하고 실패했다고 뜨는 오류가 간간히 보였습니다.
map/filter/reduce와 같은 함수들이 아닌 forEach문을 선호했기에 자바스크립트스럽게 코드를 짜지 못했고, 가독성도 많이 떨어지는 코드였습니다.

리팩토링을 통해 확장성 및 가독성을 고려해서 개선한 코드
image
image

forEach 함수가 아닌 filter 함수를 사용하였고, 각 클래스를 확인하는 함수를 따로 빼서 모든 클래스에 filter를 통해 조건에 맞는 클래스들만 반환하도록 구현했습니다.

@Bokdol11859 Bokdol11859 added 개선 기능의 변경 없이 개선 위한 이슈 TODO 아직 수정해야하는 부분을 위한 이슈 기능 구현 labels Jan 24, 2023
@Bokdol11859 Bokdol11859 self-assigned this Jan 24, 2023
@Bokdol11859 Bokdol11859 added 진행중 현재 진행중인 이슈 and removed TODO 아직 수정해야하는 부분을 위한 이슈 labels Jan 24, 2023
@Bokdol11859 Bokdol11859 added 완료 리팩토링이 끝난 이슈 and removed 진행중 현재 진행중인 이슈 labels Jan 24, 2023
@Bokdol11859 Bokdol11859 changed the title React-Query 베이스 설정 및 내 기록 페이지 백엔드 연동 [MyPage] React-Query 베이스 설정 및 내 기록 페이지 백엔드 연동 Feb 14, 2023
@Bokdol11859 Bokdol11859 pinned this issue Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
개선 기능의 변경 없이 개선 위한 이슈 기능 구현 완료 리팩토링이 끝난 이슈
Projects
Development

No branches or pull requests

1 participant