> A value computed by `remember` will be stored...
# compose
m
A value computed by
remember
will be stored in the composition tree, and only be recomputed if the keys to
remember
change. -link
What is a key?
m
The value you pass as the param to remember:
Copy code
remember(someValue) {  }
From the codelab:
Copy code
val iconAlpha: Float = remember(todo.id) { randomTint() }
Icon(todo.icon.vectorAsset, tint = contentColor().copy(alpha = iconAlpha))
The random tint will only get randomised if the id changes, otherwise the first result of the calculation will be used
👏 1
👍 1
@Leland Richardson [G] does a good job explaining the concept here:

https://youtu.be/SMOhl9RK0BA?t=334