Answers for "how to initialize livedata kotlin"

1

how to initialize livedata kotlin

fun <T : Any?> MutableLiveData<T>.default(initialValue: T) = apply { setValue(initialValue) }

val liveData = MutableLiveData<String>().default("Initial value!")
Posted by: Guest on November-21-2020

Code answers related to "how to initialize livedata kotlin"

Browse Popular Code Answers by Language