iamthevoid
08/30/2021, 10:46 AMremember
analog in SwiftUI?Abhishek Dewan
08/30/2021, 2:23 PMiamthevoid
08/30/2021, 2:25 PMremember
and then use it result next:
@Composable
fun <Component> BindWithComponent(
provideComponent: () -> Component,
content: @Composable (Component) -> Unit
) {
val component by remember(provideComponent) {
mutableStateOf(provideComponent())
}
content(component)
}
But in ios this is impossible behaviour^ if i understand correctwbertan
08/31/2021, 8:07 AMlambda
is in remember
? since its value would not change to trigger recomposition? Or Compose is “clever” to actually make a state of the return value of the lambda
?
(I see the lambda
given to remember
itself, but not sure when that would be triggered again)