Closed serjek closed 4 years ago
Unfortunately I didn't find the root of the problem yet and switched to MapSchema instead 😅
Hi @serjek, I'm checking this, wouldn't these callbacks help you achieve your goal?
state.array.onAdd +=
state.array.onRemove +=
state.array.onChange +=
Indeed the current value (value
) during the root onChange
callback only has additions in all decoders. It would be more intuitive to have the entire array as current value.
The previousValue
had a bug on colyseus-hx
- it seemed to be a reference to the actual current value, instead of the previous one - which I've fixed here https://github.com/colyseus/colyseus-hx/pull/26
I'm going to update that PR soon fixing the value
as well.
Thanks for clarifications! I guess it's ok to close the ticket once PR is merged.
It seem that ArraySchema provides only diffing value on change: update 1
update 2