Sample bug.
sola1tmy opened this issue · comments
MVVM click can't goto next Activity.
SingleLiveEvent holds null. Null won't work for bind function.
fun <T> LiveData<T>.bind(function: (data: T) -> Unit) {
observe(lifeCycleOwner, Observer { value ->
value?.let {
function(value)
}
})
}
Maybe T should be nullable?
I think Sometimes we can't make the value not null all the time.
will be fixed on release 2.0.0 (next release)
fixed on 2.0.0