-
Notifications
You must be signed in to change notification settings - Fork 1
[Refactor/#99] 모듈 구조 재정립 #210
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
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
84581c9
refactor: LaunchedEffect 재시작 -> snapshotFlow로 변경 | base 기능 함수명 변경
ThirFir 7837e3b
chore: core-ui 모듈 생성 | FeatureConventionPlugin 생성
ThirFir 8ec9e34
chore: 미사용 권한 요청 코드 제거
ThirFir dcda222
refactor: base 함수 일부 롤백(2개의 Flow 변수 -> 1개로 통합)
ThirFir 94b602a
chore: core-model 모듈 생성 | domain, core-ui 모듈에 의존성 추가
ThirFir 3e968f1
refactor: domain에서 core-model로 Model 이동
ThirFir a2a2d22
refactor: BaseViewModel, FlowExt, CompositionLocals core:ui 모듈로 이동
ThirFir ae451f4
refactor: compose utils core:ui 모듈로 이동
ThirFir e16199b
refactor: navigation 관련한 것 제외하고 feature:common -> core:ui로 모두 이동
ThirFir 7548b4b
chore: core-navigation 모듈 생성
ThirFir e2abaa3
chore: navigation 모듈 build-logic 적용, feature,app모듈 navigation 의존
ThirFir d43871a
refactor: 각 feature의 Route를 모두 navigation 모듈로 이동
ThirFir c30768e
refactor: feature-common 하의 Nav Utils를 navigation모듈로 이동
ThirFir 5591d19
chore: feature-common 삭제
ThirFir b14ff83
refactor: navigation 유틸 정리
ThirFir 758825f
chore: 레거시 Amplitude 코드 제거
ThirFir 798c977
chore: core:utils 모듈 제거
ThirFir 5f33713
refactor: ads-impl을 feature -> provider로 상위 디렉토리 변경
ThirFir 0932beb
chore: Delete unused import
ThirFir 07e4a6a
chore: provider 모듈 패키지명 컨벤션 유지
ThirFir b3322bd
chore: core-ui 모듈 패키지명 컨벤션 유지
ThirFir 2ff6503
chore: core-navigation 모듈 패키지명 컨벤션 유지
ThirFir 7f9a72e
chore: core-model 모듈 패키지명 컨벤션 유지
ThirFir 88f1cfc
chore: core-analytics 모듈 패키지명 컨벤션 유지
ThirFir 88a41c7
chore: core-adsapi 모듈 패키지명 컨벤션 유지
ThirFir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint | |
| import android.location.Location | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.LaunchedEffect | ||
| import androidx.compose.runtime.snapshotFlow | ||
| import androidx.lifecycle.ViewModel | ||
| import com.acon.acon.domain.type.UserType | ||
| import com.acon.feature.common.compose.LocalLocation | ||
|
|
@@ -12,6 +13,8 @@ import com.acon.feature.common.compose.LocalUserType | |
| import com.acon.feature.common.coroutine.firstNotNull | ||
| import kotlinx.coroutines.flow.MutableStateFlow | ||
| import kotlinx.coroutines.flow.asStateFlow | ||
| import kotlinx.coroutines.flow.filterNotNull | ||
| import kotlinx.coroutines.flow.onEach | ||
| import kotlinx.coroutines.suspendCancellableCoroutine | ||
| import org.orbitmvi.orbit.ContainerHost | ||
| import org.orbitmvi.orbit.annotation.OrbitDsl | ||
|
|
@@ -20,7 +23,10 @@ import org.orbitmvi.orbit.annotation.OrbitDsl | |
| abstract class BaseContainerHost<STATE : Any, SIDE_EFFECT : Any>() : | ||
| ContainerHost<STATE, SIDE_EFFECT>, ViewModel() { | ||
|
|
||
| private val liveLocation = MutableStateFlow<Location?>(null) | ||
| private val _liveLocation = MutableStateFlow<Location?>(null) | ||
| private val liveLocation = _liveLocation.filterNotNull().onEach { | ||
| onNewLocation(it) | ||
| } | ||
|
|
||
| private val _userType = MutableStateFlow(UserType.GUEST) | ||
| protected val userType = _userType.asStateFlow() | ||
|
|
@@ -35,21 +41,24 @@ abstract class BaseContainerHost<STATE : Any, SIDE_EFFECT : Any>() : | |
| } | ||
|
|
||
| @Composable | ||
| fun emitUserType() { | ||
| fun useUserType() { | ||
| val userType = LocalUserType.current | ||
|
|
||
| LaunchedEffect(userType) { | ||
| _userType.value = userType | ||
| LaunchedEffect(Unit) { | ||
| snapshotFlow { userType }.collect { | ||
| _userType.value = userType | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Composable | ||
| fun emitLiveLocation() { | ||
| fun useLiveLocation() { | ||
| val newLocation = LocalLocation.current | ||
|
|
||
| LaunchedEffect(newLocation) { | ||
| liveLocation.emit(newLocation) | ||
| newLocation?.let { onNewLocation(it) } | ||
| LaunchedEffect(Unit) { | ||
| snapshotFlow { newLocation }.filterNotNull().collect { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기도 snapshotFlow로 바꾸신 이유가 뭔지 설명해주실 수 있나요?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 위와 동일합니다!! |
||
| _liveLocation.emit(it) | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
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
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
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
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
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
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.
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.
여기를 snapshotFlow로 바꾸신 이유가 뭔지 설명해주실 수 있나요?
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.
자주 바뀔 수 있는 값인데, LaunchedEffect 키로 걸어주면 바뀔 때마다 코루틴이 재실행되므로 비효율적이라고 판단했기 때문입니다