📜  如何初始化 livedata kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:33.588000             🧑  作者: Mango

代码示例1
fun  MutableLiveData.default(initialValue: T) = apply { setValue(initialValue) }

val liveData = MutableLiveData().default("Initial value!")