removed distinct

This commit is contained in:
Vladimir 2020-07-30 13:41:12 +05:00
parent 6064978b85
commit 61d7a4a075
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package ru.touchin.roboswag.mvi_arch.core
import android.os.Parcelable
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.Transformations
@ -36,7 +37,7 @@ abstract class MviViewModel<NavArgs : Parcelable, Action : ViewAction, State : V
protected val navArgs: NavArgs = handle.get(MviFragment.INIT_ARGS_KEY) ?: throw IllegalStateException("Nav args mustn't be null")
protected val _state = MutableLiveData(initialState)
internal val state = Transformations.distinctUntilChanged(_state)
internal val state = _state as LiveData<State>
protected val currentState: State
get() = state.value ?: initialState