Alexander S
07/17/2023, 9:30 PMdata class PointPath(
val pathPoints: List<PathPoint>,
) {
fun smoothPath(): PointPath { ... }
}
I made the data class immutable since recompositing isn't triggered when the list is updated and made it so anything that modifies it returns a copy (ex. smoothPath
). However, this feels very cumbersome since I need to manually update the state with the returned copy. Is there a more effective way to do this, especially when it comes to handling the state when object properties change?Stylianos Gakis
07/17/2023, 9:34 PMmutableStateListOf
, or just do a .copy
on your object each time it changes, I think those are your options