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

refactor: suspendOnXXX() 함수 제거 #949

Merged
merged 1 commit into from
Jan 16, 2025
Merged

refactor: suspendOnXXX() 함수 제거 #949

merged 1 commit into from
Jan 16, 2025

Conversation

kimhm0728
Copy link
Contributor

@kimhm0728 kimhm0728 commented Jan 12, 2025

🚩 연관 이슈

close #948


📝 작업 내용

  • ApiResultExtensions의 suspend 키워드 제거 -> inline 키워드 추가

🏞️ 스크린샷 (선택)


🗣️ 리뷰 요구사항 (선택)

suspendOnXXX()onXXX() 함수가 두개씩 있는게 유지보수성과 가독성이 좋지 않은 것 같아서
코틀린의 ResultonXXX()는 어떻게 구현되어있는지 찾아봤어요.
그런데 suspend 처리에 관련된 로직은 안보이고 그냥 inline 키워드가 붙어있더라구요 ..
람다가 호출한 쪽에 inline되는 거면 호출한 쪽의 컨텍스트에 따라 suspend 함수를 호출할 수 있으니 suspendOnXXX()를 굳이 만들 필요가 없었어요!

추가적으로 ApiResultExtensions에서 suspend 붙은 함수들 모두 적용했습니다.
호출하는 쪽에서 suspend인지 아닌지에 따라 호출할 함수를 결정하는 건 좋지 못한 방식인 것 같아서요 ...
넘 간단하게 해결해서 기분 좋음 ㅎ

@kimhm0728 kimhm0728 requested a review from haeum808 January 12, 2025 16:14
@kimhm0728 kimhm0728 self-assigned this Jan 12, 2025
@kimhm0728 kimhm0728 changed the title refactor: suspendOnXXX 함수 제거 refactor: suspendOnXXX() 함수 제거 Jan 12, 2025
Copy link
Contributor

@haeum808 haeum808 left a comment

Choose a reason for hiding this comment

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

코드가 훨씬 깔끔해졌네요! 고생하셨습니다!
inline 넘 좋네요!

@kimhm0728 kimhm0728 merged commit 64ea55e into develop Jan 16, 2025
2 checks passed
@kimhm0728 kimhm0728 deleted the feature/948 branch January 29, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: suspendOnXXX() 함수 제거
2 participants