Conversation
…notice-board-write # Conflicts: # app/src/main/java/com/konkuk/arabyte_aos/presentation/ui/noticeboard/NoticeBoardListScreen.kt # app/src/main/java/com/konkuk/arabyte_aos/presentation/ui/noticeboard/navigation/NoticeBoardNavigation.kt
t1nm1ksun
approved these changes
May 12, 2025
| viewModel.setSideEffect(NoticeBoardWriteContract.NoticeBoardWriteSideEffect.NavigateToBack) | ||
| }, | ||
| writeCompleteButtonClicked = { | ||
| // viewModel.setSideEffect(NoticeBoardWriteContract.NoticeBoardWriteSideEffect.NavigateToNoticeBoardList) |
Collaborator
Author
There was a problem hiding this comment.
어엇;; 안지웠네요... 바로 삭제!!
Comment on lines
+104
to
+109
| Column( | ||
| modifier = | ||
| modifier | ||
| .fillMaxSize() | ||
| .padding(paddingValues), | ||
| ) { |
Collaborator
There was a problem hiding this comment.
화면 배경색 지정안해줘도 되는 부분일까요??
Comment on lines
+52
to
+68
| postNoticeBoardWriteUseCase( | ||
| postNoticeBoardWrite = | ||
| PostNoticeBoardWrite( | ||
| title = currentState.titleText, | ||
| text = currentState.contentText, | ||
| likeCount = 0, | ||
| isAnonymous = currentState.selectIsAnonymous, | ||
| articleKind = currentState.selectCategory?.name.toString(), | ||
| articleImages = emptyList(), | ||
| anonymous = currentState.selectIsAnonymous, | ||
| ), | ||
| ) | ||
| if (result.isSuccess) { | ||
| setSideEffect(NoticeBoardWriteContract.NoticeBoardWriteSideEffect.NavigateToNoticeBoardList) | ||
| } else { | ||
| setSideEffect(NoticeBoardWriteContract.NoticeBoardWriteSideEffect.ShowServerErrorToast) | ||
| } |
Collaborator
There was a problem hiding this comment.
result가 isSuccess인거랑 저희가 평소에 사용하던 onSuccess랑 뭐가 다를까요?
Collaborator
Author
There was a problem hiding this comment.
Result 의 결과 관련 반환 값으로만 생각하고 있었는데,
isSuccess -> 성공 여부만 확인, 조건문으로 명시적 분기
onSuccess -> 성공 시 실행할 코드 블록 작성, 람다 내부 처리
이것이 대표적인 차이점인 것 같아요.
result 의 반환 값을 꺼내야 할 때는 onSuccess 을 써야겠네요.
반면 result을 Unit으로 처리했을 땐, 이 구조가 더 깔끔한 것 같아요!!
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
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.
📌 𝗜𝘀𝘀𝘂𝗲𝘀
📎 𝗪𝗼𝗿𝗸 𝗗𝗲𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻
📷 𝗦𝗰𝗿𝗲𝗲𝗻𝘀𝗵𝗼𝘁
2025-05-12.4.46.40.mov
😅 Uncompleted Tasks
💬 𝗧𝗼 𝗥𝗲𝘃𝗶𝗲𝘄𝗲𝗿𝘀
정처기 화이팅!