RanvierMUD / core

Core engine code for Ranvier
https://ranviermud.com
MIT License
45 stars 40 forks source link

Adds a check to only fire the metadata update event if there's an actual change to the data #70

Open holl0wstar opened 5 years ago

holl0wstar commented 5 years ago

As discussed on Slack, I forgot to implement this initially.

seanohue commented 5 years ago

I'm testing this soon, but two pieces of feedback: a) If for some reason, value is an object/array or other non-primitive data type, it could be exactly the same and still emit the event. This is probably okay but something to note in the docs.

b) I'd consider moving the check to be before base[property] = value because if it is exactly the same, why reassign it? Very minor optimization though, to be honest.