Skip to content

Commit 085d3d6

Browse files
committed
♻️ Fragment에있는 init{ } 삭제
1 parent de2cd13 commit 085d3d6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

presentation/src/main/java/com/whyranoid/presentation/community/CommunityItemFragment.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ internal class CommunityItemFragment :
2121

2222
private val viewModel: CommunityViewModel by viewModels()
2323

24-
init {
25-
observe()
26-
}
27-
2824
private val category by lazy {
2925
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
3026
arguments?.getSerializable(COMMUNITY_CATEGORY_KEY, CommunityCategory::class.java)
@@ -38,6 +34,8 @@ internal class CommunityItemFragment :
3834
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
3935
super.onViewCreated(view, savedInstanceState)
4036

37+
observeState()
38+
4139
// TODO : 카테고리 별 다른 Shimmer Layout 생성
4240
when (category) {
4341
CommunityCategory.BOARD -> {
@@ -52,7 +50,7 @@ internal class CommunityItemFragment :
5250
}
5351
}
5452

55-
private fun observe() {
53+
private fun observeState() {
5654
repeatWhenUiStarted {
5755
viewModel.eventFlow.collect { event ->
5856
handleEvent(event)

0 commit comments

Comments
 (0)