Indu
03/08/2021, 6:56 AMLukasz Burcon
03/08/2021, 7:09 AMIndu
03/08/2021, 7:55 AMAlbert Chang
03/08/2021, 8:03 AMThis way if the effect is relaunched when one of its key is updated it will get the updated value or callback which is referred in the effect.You will always get the latest value when you read the state. This has nothing to do with whether the effect is relaunched or not.
Albert Chang
03/08/2021, 8:04 AMrememberUpdatedState
you'll see that it's simply remember { mutableStateOf(newValue) }.apply { value = newValue }
.Indu
03/08/2021, 8:10 AMAlbert Chang
03/08/2021, 8:12 AMIndu
03/08/2021, 8:17 AMZach Klippenstein (he/him) [MOD]
03/08/2021, 4:43 PMZach Klippenstein (he/him) [MOD]
03/08/2021, 4:45 PMAlbert Chang
03/09/2021, 4:14 AMIndu
03/09/2021, 4:20 AMIndu
03/09/2021, 4:38 AMAlbert Chang
03/09/2021, 4:41 AMLaunchedEffect
won't be restarted unless the keys change.