Could/should a data class with a `@Composable` par...
# compose
a
Could/should a data class with a
@Composable
parameter be marked as
@Immutable
? I've got something like this for controlling what is in a
TopAppBar
as part of a `Scaffold`:
Copy code
private data class MyTopAppBarState(
    @StringRes val titleResId: Int,
    val actions: (@Composable RowScope.() -> Unit)?,
)
The contents of the
actions
Composable lambda are `TextButton`s with
onClick
lambdas that would likely reference a ViewModel. I don't know if that matters, but it feels like it might.
z
If the value of the property pointing to the function can’t change, then it should qualify. I would think it should be inferred stable too
a
Ok I think that makes sense. It felt like it made sense to be
@Immutable
. I'll do some more testing on it I suppose.