How do we properly convert `State<List<T>>` to `Sn...
# compose
t
How do we properly convert
State<List<T>>
to
SnapshotStateList<T>
? The best I could come up with is this, but it feels stupid, I wonder if there is a better way.
Copy code
val a: State<List<T>> = viewModel.collectAsStateWithLifecycle(initialValue = emptyList())
val b: SnapshotStateList<T> by remember{
    derivedStateOf {
        mutableStateListOf<T>().apply {
            addAll(a.value)
        }
    }
}
(note that when the original
State<List<T>>
updates, the
SnapshotStateList<T>
should also update)