thana
07/11/2022, 8:45 AMprivate val mutable = mutableListOf<Something>()
val readonly: List<Something> = mutable
which is kinda uglySam
07/11/2022, 8:51 AMKamilH
07/11/2022, 8:51 AMMutableList
and modify it from the outside. To avoid this you should use:
mutable.toList()
thana
07/11/2022, 8:54 AMthana
07/11/2022, 8:54 AMKamilH
07/11/2022, 8:55 AMthana
07/11/2022, 9:03 AM