Are there any circumstances in which one should prefer one of these alternatives over the other?
@Composable
fun <T> Foo(data: State<T>) { ... }
compared to
@Composable
fun <T> Foo(data: T) { ... }
Or with mutable states,
@Composable
fun <T> Foo(data: MutableState<T>) { ... }
compared to
@Composable
fun <T> Foo(data: T, setData: (T) -> Unit) { ... }
Clearly one advantage of having a setData lambda is you can intercept the set operation, but I'm more interested from a Compose perspective. Are there any implications for the compose compiler or how recomposition will work?