Understanding @Stable, @Immutable, ImmutableCollection, and PersistentCollection in Jetpack Compose
Published in
8 min readOct 24, 2023
This article explores what @Stable
, @Immutable
, ImmutableCollection
, and PersistentCollection
mean, and how they affect Jetpack Compose recomposition.
Why is stability important?
If all of a Composable function’s parameters are stable, the Compose compiler will mark it as a skippable function. Skippable means that if the function is called during recomposition and its parameters haven’t changed since its last invocation…