Here is my MutableStateFlow value I try to work with:
val songList: MutableStateFlow<MutableList<Song>> = MutableStateFlow(arrayListOf())
I need to observe changes (after methods like add, removeAt etc.) on my MutableList above but can't achieve that. My guess is since only the elements of the list change instead of the list itself, collect method doesn't get fired.
How can I achieve that using StateFlow if possible? If not, what is the correct way to do it?
Note that I need initial value of arrayListOf(), so LiveData probably won't be enough for me.