Fixed server update listener

This commit is contained in:
hydrabolt
2015-11-01 14:09:00 +00:00
parent 5adcb5b8eb
commit 7175218ecf
14 changed files with 129 additions and 12 deletions

View File

@@ -48,8 +48,9 @@ class Cache extends Array {
}
update(old, data) {
var index = this.get(this.discrim, old);
if (~index) {
var item = this.get(this.discrim, old[this.discrim]);
if (item) {
var index = this.indexOf(item);
this[index] = data;
return this[index];
} else {
@@ -62,7 +63,7 @@ class Cache extends Array {
if (~index) {
this.splice(index, 1);
} else {
var item = this.get(this.discrim, data.id);
var item = this.get(this.discrim, data[this.discrim]);
if (item) {
this.splice(this.indexOf(item), 1);
}

View File

@@ -24,6 +24,11 @@ class Equality{
}
return false;
}
equalsStrict(object){
// override per class type
return;
}
}
module.exports = Equality;