Join Slack
Powered by
What is the difference between LaunchedEffect(Unit...
# compose
m
Mehdi Haghgoo
12/03/2022, 4:47 PM
What is the difference between LaunchedEffect(Unit) and LaunchedEffect(true)?
h
hfhbd
12/03/2022, 4:57 PM
There is no difference, you could also use
LaunchedEffect(42)
or any non changing value/expression
r
Rick Regan
12/03/2022, 6:28 PM
Also confirmed implicitly by
this
t
Tariyel Islami
12/03/2022, 8:04 PM
The code you have written in it will run every time the key of the Launched effect changes. If you set true or a value that will not change, it will only run once. Unit represents the composable function that you wrote the Launched effect.
8
Views
Open in Slack
Previous
Next