Skip to content

Commit 67de431

Browse files
authored
Merge pull request #135 from YAPP-Github/chore/#134-update-orbit-mvi-v10.0.0
[Chore/#134] Orbit-MVI 라이브러리 버전을 업데이트 합니다. (v6.1.0 -> v10.0.0)
2 parents 9c53471 + 4ddb0d7 commit 67de431

File tree

16 files changed

+32
-41
lines changed

16 files changed

+32
-41
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ espressoCore = "3.6.1"
5050

5151
## Other
5252
material = "1.12.0"
53-
orbit = "6.1.0"
53+
orbit = "10.0.0"
5454
javax = "1"
5555
kakaoLogin = "2.21.4"
5656
lottie-compose = "6.6.0"

presentation/src/main/java/com/threegap/bitnagil/presentation/common/mviviewmodel/MviViewModel.kt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import androidx.lifecycle.ViewModel
55
import kotlinx.coroutines.flow.Flow
66
import kotlinx.coroutines.flow.StateFlow
77
import org.orbitmvi.orbit.ContainerHost
8-
import org.orbitmvi.orbit.syntax.simple.SimpleSyntax
9-
import org.orbitmvi.orbit.syntax.simple.intent
10-
import org.orbitmvi.orbit.syntax.simple.postSideEffect
11-
import org.orbitmvi.orbit.syntax.simple.reduce
8+
import org.orbitmvi.orbit.syntax.Syntax
129
import org.orbitmvi.orbit.viewmodel.container
1310

1411
abstract class MviViewModel<STATE : MviState, SIDE_EFFECT : MviSideEffect, INTENT : MviIntent>(
@@ -20,12 +17,8 @@ abstract class MviViewModel<STATE : MviState, SIDE_EFFECT : MviSideEffect, INTEN
2017
val stateFlow: StateFlow<STATE> get() = container.stateFlow
2118
val sideEffectFlow: Flow<SIDE_EFFECT> get() = container.sideEffectFlow
2219

23-
protected suspend fun SimpleSyntax<STATE, SIDE_EFFECT>.sendSideEffect(sideEffect: SIDE_EFFECT) = postSideEffect(sideEffect)
24-
25-
protected abstract suspend fun SimpleSyntax<STATE, SIDE_EFFECT>.reduceState(
26-
intent: INTENT,
27-
state: STATE,
28-
): STATE?
20+
protected suspend fun Syntax<STATE, SIDE_EFFECT>.sendSideEffect(sideEffect: SIDE_EFFECT) = postSideEffect(sideEffect)
21+
protected abstract suspend fun Syntax<STATE, SIDE_EFFECT>.reduceState(intent: INTENT, state: STATE): STATE?
2922

3023
fun sendIntent(intent: INTENT) =
3124
intent {

presentation/src/main/java/com/threegap/bitnagil/presentation/emotion/EmotionViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import com.threegap.bitnagil.presentation.emotion.model.mvi.EmotionState
1515
import dagger.hilt.android.lifecycle.HiltViewModel
1616
import kotlinx.coroutines.delay
1717
import kotlinx.coroutines.launch
18-
import org.orbitmvi.orbit.syntax.simple.SimpleSyntax
18+
import org.orbitmvi.orbit.syntax.Syntax
1919
import javax.inject.Inject
2020

2121
@HiltViewModel
@@ -47,7 +47,7 @@ class EmotionViewModel @Inject constructor(
4747
}
4848
}
4949

50-
override suspend fun SimpleSyntax<EmotionState, EmotionSideEffect>.reduceState(intent: EmotionIntent, state: EmotionState): EmotionState? {
50+
override suspend fun Syntax<EmotionState, EmotionSideEffect>.reduceState(intent: EmotionIntent, state: EmotionState): EmotionState? {
5151
when (intent) {
5252
is EmotionIntent.EmotionListLoadSuccess -> {
5353
return state.copy(

presentation/src/main/java/com/threegap/bitnagil/presentation/guide/GuideViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import com.threegap.bitnagil.presentation.guide.model.GuideIntent
66
import com.threegap.bitnagil.presentation.guide.model.GuideSideEffect
77
import com.threegap.bitnagil.presentation.guide.model.GuideState
88
import dagger.hilt.android.lifecycle.HiltViewModel
9-
import org.orbitmvi.orbit.syntax.simple.SimpleSyntax
9+
import org.orbitmvi.orbit.syntax.Syntax
1010
import javax.inject.Inject
1111

1212
@HiltViewModel
@@ -16,7 +16,7 @@ class GuideViewModel @Inject constructor(
1616
initState = GuideState(),
1717
savedStateHandle = savedStateHandle,
1818
) {
19-
override suspend fun SimpleSyntax<GuideState, GuideSideEffect>.reduceState(
19+
override suspend fun Syntax<GuideState, GuideSideEffect>.reduceState(
2020
intent: GuideIntent,
2121
state: GuideState,
2222
): GuideState? {

presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import kotlinx.coroutines.flow.distinctUntilChanged
2828
import kotlinx.coroutines.flow.drop
2929
import kotlinx.coroutines.flow.map
3030
import kotlinx.coroutines.launch
31-
import org.orbitmvi.orbit.syntax.simple.SimpleSyntax
31+
import org.orbitmvi.orbit.syntax.Syntax
3232
import java.time.LocalDate
3333
import javax.inject.Inject
3434

@@ -61,7 +61,7 @@ class HomeViewModel @Inject constructor(
6161
fetchTodayEmotion(LocalDate.now())
6262
}
6363

64-
override suspend fun SimpleSyntax<HomeState, HomeSideEffect>.reduceState(
64+
override suspend fun Syntax<HomeState, HomeSideEffect>.reduceState(
6565
intent: HomeIntent,
6666
state: HomeState,
6767
): HomeState? {

presentation/src/main/java/com/threegap/bitnagil/presentation/login/LoginViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import com.threegap.bitnagil.presentation.login.model.LoginSideEffect
1111
import com.threegap.bitnagil.presentation.login.model.LoginState
1212
import dagger.hilt.android.lifecycle.HiltViewModel
1313
import kotlinx.coroutines.launch
14-
import org.orbitmvi.orbit.syntax.simple.SimpleSyntax
14+
import org.orbitmvi.orbit.syntax.Syntax
1515
import javax.inject.Inject
1616

1717
@HiltViewModel
@@ -22,7 +22,7 @@ class LoginViewModel @Inject constructor(
2222
initState = LoginState(),
2323
savedStateHandle = savedStateHandle,
2424
) {
25-
override suspend fun SimpleSyntax<LoginState, LoginSideEffect>.reduceState(
25+
override suspend fun Syntax<LoginState, LoginSideEffect>.reduceState(
2626
intent: LoginIntent,
2727
state: LoginState,
2828
): LoginState? =

presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/MyPageViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.threegap.bitnagil.presentation.mypage.model.MyPageSideEffect
99
import com.threegap.bitnagil.presentation.mypage.model.MyPageState
1010
import dagger.hilt.android.lifecycle.HiltViewModel
1111
import kotlinx.coroutines.launch
12-
import org.orbitmvi.orbit.syntax.simple.SimpleSyntax
12+
import org.orbitmvi.orbit.syntax.Syntax
1313
import javax.inject.Inject
1414

1515
@HiltViewModel
@@ -41,7 +41,7 @@ class MyPageViewModel @Inject constructor(
4141
}
4242
}
4343

44-
override suspend fun SimpleSyntax<MyPageState, MyPageSideEffect>.reduceState(
44+
override suspend fun Syntax<MyPageState, MyPageSideEffect>.reduceState(
4545
intent: MyPageIntent,
4646
state: MyPageState,
4747
): MyPageState {

presentation/src/main/java/com/threegap/bitnagil/presentation/onboarding/OnBoardingViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import kotlinx.coroutines.Job
2525
import kotlinx.coroutines.async
2626
import kotlinx.coroutines.isActive
2727
import kotlinx.coroutines.launch
28-
import org.orbitmvi.orbit.syntax.simple.SimpleSyntax
28+
import org.orbitmvi.orbit.syntax.Syntax
2929

3030
@HiltViewModel(assistedFactory = OnBoardingViewModel.Factory::class)
3131
class OnBoardingViewModel @AssistedInject constructor(
@@ -119,7 +119,7 @@ class OnBoardingViewModel @AssistedInject constructor(
119119
}
120120
}
121121

122-
override suspend fun SimpleSyntax<OnBoardingState, OnBoardingSideEffect>.reduceState(
122+
override suspend fun Syntax<OnBoardingState, OnBoardingSideEffect>.reduceState(
123123
intent: OnBoardingIntent,
124124
state: OnBoardingState,
125125
): OnBoardingState? {

presentation/src/main/java/com/threegap/bitnagil/presentation/recommendroutine/RecommendRoutineViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import com.threegap.bitnagil.presentation.recommendroutine.model.RecommendRoutin
1515
import com.threegap.bitnagil.presentation.recommendroutine.model.toUiModel
1616
import dagger.hilt.android.lifecycle.HiltViewModel
1717
import kotlinx.coroutines.launch
18-
import org.orbitmvi.orbit.syntax.simple.SimpleSyntax
18+
import org.orbitmvi.orbit.syntax.Syntax
1919
import javax.inject.Inject
2020

2121
@HiltViewModel
@@ -35,7 +35,7 @@ class RecommendRoutineViewModel @Inject constructor(
3535

3636
private var recommendRoutines: RecommendRoutinesUiModel = RecommendRoutinesUiModel()
3737

38-
override suspend fun SimpleSyntax<RecommendRoutineState, RecommendRoutineSideEffect>.reduceState(
38+
override suspend fun Syntax<RecommendRoutineState, RecommendRoutineSideEffect>.reduceState(
3939
intent: RecommendRoutineIntent,
4040
state: RecommendRoutineState,
4141
): RecommendRoutineState? = when (intent) {

presentation/src/main/java/com/threegap/bitnagil/presentation/routinelist/RoutineListViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import com.threegap.bitnagil.presentation.routinelist.model.RoutineListState
1515
import com.threegap.bitnagil.presentation.routinelist.model.toUiModel
1616
import dagger.hilt.android.lifecycle.HiltViewModel
1717
import kotlinx.coroutines.launch
18-
import org.orbitmvi.orbit.syntax.simple.SimpleSyntax
18+
import org.orbitmvi.orbit.syntax.Syntax
1919
import java.time.LocalDate
2020
import javax.inject.Inject
2121

@@ -43,7 +43,7 @@ class RoutineListViewModel @Inject constructor(
4343
observeRoutineChanges()
4444
}
4545

46-
override suspend fun SimpleSyntax<RoutineListState, RoutineListSideEffect>.reduceState(
46+
override suspend fun Syntax<RoutineListState, RoutineListSideEffect>.reduceState(
4747
intent: RoutineListIntent,
4848
state: RoutineListState,
4949
): RoutineListState? {

0 commit comments

Comments
 (0)