Revert "removed distinct"

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

View File

@ -1,7 +1,6 @@
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
@ -37,7 +36,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 = _state as LiveData<State>
internal val state = Transformations.distinctUntilChanged(_state)
protected val currentState: State
get() = state.value ?: initialState