diff --git a/link/src/main/java/com/stripe/android/link/LinkActivityViewModel.kt b/link/src/main/java/com/stripe/android/link/LinkActivityViewModel.kt index 44eca6f578a..75bd2bfeb5b 100644 --- a/link/src/main/java/com/stripe/android/link/LinkActivityViewModel.kt +++ b/link/src/main/java/com/stripe/android/link/LinkActivityViewModel.kt @@ -5,7 +5,7 @@ import androidx.lifecycle.ViewModelProvider import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flowOf -internal class LinkActivityViewModel : LinkViewModel( +internal class LinkActivityViewModel : StateAndEffectsVM( initialState = LinkState, ) { override fun actionToResult(action: LinkAction): Flow { diff --git a/link/src/main/java/com/stripe/android/link/LinkViewModel.kt b/link/src/main/java/com/stripe/android/link/StateAndEffectsVM.kt similarity index 95% rename from link/src/main/java/com/stripe/android/link/LinkViewModel.kt rename to link/src/main/java/com/stripe/android/link/StateAndEffectsVM.kt index 2237a1de7b9..630a41a88aa 100644 --- a/link/src/main/java/com/stripe/android/link/LinkViewModel.kt +++ b/link/src/main/java/com/stripe/android/link/StateAndEffectsVM.kt @@ -12,7 +12,7 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch -internal abstract class LinkViewModel( +internal abstract class StateAndEffectsVM( initialState: State, ) : ViewModel() { private val actionChannel = Channel(Channel.UNLIMITED) diff --git a/link/src/main/java/com/stripe/android/link/ui/signup/SignUpViewModel.kt b/link/src/main/java/com/stripe/android/link/ui/signup/SignUpViewModel.kt index dc81fa302c5..fa9472d1759 100644 --- a/link/src/main/java/com/stripe/android/link/ui/signup/SignUpViewModel.kt +++ b/link/src/main/java/com/stripe/android/link/ui/signup/SignUpViewModel.kt @@ -1,10 +1,10 @@ package com.stripe.android.link.ui.signup -import com.stripe.android.link.LinkViewModel +import com.stripe.android.link.StateAndEffectsVM import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow -internal class SignUpViewModel : LinkViewModel( +internal class SignUpViewModel : StateAndEffectsVM( initialState = SignUpViewState() ) { override fun actionToResult(action: SignUpAction): Flow {