Hello guys! Have the following issue: I want to tr...
# announcements
y
Hello guys! Have the following issue: I want to track any change in my Map to notify a callback later, and what I did for now (this is just a rush attempt, so the solution may be bad): The map impl: https://pastebin.com/G5HK9jE6 The list impl: https://pastebin.com/ViKrnJQ2 (used in the map
values
) The set impl: https://pastebin.com/zfHS0KZc (used in the map
keys
,
entities
) I hope there is a proper solution, and you can say what I'm doing wrong (or maybe this is the only way)
r
since you are trying to do this my first question would be: what if someone edits the objects themselves? because there is no way you can catch that, only hope that users of the collection won't do it/use immutable keys/values
j
Do you mean ObservableMap ?
y
@Roukanken then it will be the user problem, now I'm trynna implement this issue https://github.com/kotlingang/kds/issues/16 There are different mutation API available if you want to.
@James Richardson Yes, but in ObservableMap I want know was the value edited, removed or added. There I don't need this information, I need just signal about data changed.
j
You could write an adapter to adapt the map change listener to call your own callback, which could be simpler.
y
Hmm, but anyway, then I should implement the
ObservableMap
, isn't it? Since I am doing a library, not a project, I want to implement anything with myself.