I'm trying to be notified when an array changes its content. Through this code I'm able to notify the setting of the array, but nothing happens when a new item is inserted.
var array: MutableMap<String, List<String>> = mutableMapOf()
set(value) {
field = value
arrayListener?.notify()
}
The only thing I came up with is resetting the array to itself everytime I add, delete o edit items, like this:
array = array
I read this question How to watch for array changes? relative to Javascript, but I'd like an easier solution then creating a new object, can anyone suggest it?