How do we properly convert `State<List<T>>` to `Sn...
# compose
t
How do we properly convert
State<ListT>
to
SnapshotStateListT
? 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<ListT> = viewModel.collectAsStateWithLifecycle(initialValue = emptyList())
val b: SnapshotStateListT by remember{
    derivedStateOf {
        mutableStateListOfT().apply {
            addAll(a.value)
        }
    }
}
(note that when the original
State<ListT>
updates, the
SnapshotStateListT
should also update)