Rachel
Toggle table of contents
3.5.0
common
Target filter
common
Switch theme
Search in API
Skip to content
Rachel
love.yinlin.compose.platform-view
/
love.yinlin.compose.ui
/
BasicPlatformView
/
Monitor
Monitor
@
Composable
fun
Monitor
(
key1
:
Any
?
,
block
:
suspend
CoroutineScope
.
(
T
)
->
Unit
)
等同于 LaunchedEffect, 但会监听自身创建。 因为重组是无序的,使用 Monitor 可以避免 HostView 未被创建时就触发了 key 变化而后续不触发的问题。
@
Composable
fun
Monitor
(
key1
:
Any
?
,
key2
:
Any
?
,
block
:
suspend
CoroutineScope
.
(
T
)
->
Unit
)
@
Composable
fun
Monitor
(
vararg
keys
:
Any
?
,
block
:
suspend
CoroutineScope
.
(
T
)
->
Unit
)