-
Notifications
You must be signed in to change notification settings - Fork 0
[refactor] 불필요한 Recomposition 개선 #57
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- SearchActions : @stable을 적용하고 SearchScreen에서 발생하는 람다 이벤트를 관리 - SearchScreen : remember를 통해 리컴포즈 될 때 같은 콜백 참조 스킵
- state를 전부 전달 시, filter 상태가 아닌 다른 state가 변경되더라도 불필요한 리컴포지션 발생
- Filter 콜백 이벤트
- 검색어 입력, 검색결과 선택 시 검색어 포커스 clear
- 초기 데이터 지연 시, "결과 없음" 문구 노출 방지
- 기존 하위 Composable에서 관리하고 있어, 직접 상태를 넘겨줘야 했으나 공통 Effect 관리 사용으로 재사용성 향상
f-lab-pepe
reviewed
Oct 13, 2025
onEvent(SearchContract.Event.OnClickSearchProduct(productName)) | ||
|
||
fun onRemoveSearchKeyword(keyword: String) = | ||
onEvent(SearchContract.Event.OnProductClick(keyword)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onRemoveSearchKeyword 인데 OnProductClick 이벤트네요!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 해당 부분 수정하겠습니다!😂
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔖 요약
🛠 작업 내용
SearchActions
를 통해 이벤트 콜백을 중앙화하여 처리하고, remember를 사용하여 인스턴스를 1번만 생성하여 리컴포지션이 발생했을 때 동일한 인스턴스를 재사용하도록 하였습니다.SearchActions와 FilterActions
에@Stable
을 명시하여, 객체를 안정적으로 인지하고 리컴포지션을 효율적으로 스킵할 수 있도록 구현하였습니다.❓ 궁금 사항**
SearchActions
안에FilterActions
를 적용한 방식처럼 사용하는 지 궁금합니다.