pref: 懒加载优化
This commit is contained in:
parent
3a3356a4bb
commit
acb75f8b8a
|
|
@ -94,7 +94,7 @@ inline fun <INTENT : UiIntent, reified VM : BaseViewModel<INTENT, *, *, *>> page
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (initialIntent.isNotEmpty()) {
|
if (initialIntent.isNotEmpty()) {
|
||||||
LaunchedEffect(key1 = "initialize") {
|
LaunchedEffect(key1 = initialized) {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
initialized = true
|
initialized = true
|
||||||
initialIntent.asFlow()
|
initialIntent.asFlow()
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ fun LazyLoad(
|
||||||
loaded: Boolean,
|
loaded: Boolean,
|
||||||
onLoad: () -> Unit,
|
onLoad: () -> Unit,
|
||||||
) {
|
) {
|
||||||
LaunchedEffect(onLoad) {
|
LaunchedEffect(key1 = loaded, key2 = onLoad) {
|
||||||
if (!loaded) onLoad()
|
if (!loaded) onLoad()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue