diff --git a/src/index.ts b/src/index.ts index a3b65bb..d11c25e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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) {