*Add item-added and item-removed events
This commit is contained in:
parent
24b97d5288
commit
48ceded78f
|
@ -236,11 +236,13 @@ export default class DHTCache extends EventEmitter {
|
|||
if (Type.ADD_ITEM === type) {
|
||||
this._ensureItem(bufData);
|
||||
this._addEntityConnection(id, bufData);
|
||||
this.emit("item-added", id, bufData);
|
||||
}
|
||||
|
||||
if (Type.REMOVE_ITEM === type) {
|
||||
this.removeItem(bufData);
|
||||
this._pruneItems();
|
||||
this.emit("item-removed", id, bufData);
|
||||
}
|
||||
}
|
||||
} else if (type === Type.CONNECTED) {
|
||||
|
|
Loading…
Reference in New Issue