*Add item-added and item-removed events

This commit is contained in:
Derrick Hammer 2022-11-24 01:46:55 -05:00
parent 24b97d5288
commit 48ceded78f
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 0 deletions

View File

@ -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) {