Skip to content

Commit

Permalink
correctly bind event listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
danisharora099 committed Aug 30, 2023
1 parent 925b4d4 commit 7911491
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/lib/base_protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ export class BaseProtocol extends StreamManager implements IBaseProtocol {

this.addLibp2pEventListener(
"peer:update",
super.handlePeerUpdateStreamPool
super.handlePeerUpdateStreamPool.bind(this)
);
// TODO: might be better to check with `connection:close` event
this.addLibp2pEventListener(
"peer:disconnect",
super.handlePeerDisconnectStreamPool
super.handlePeerDisconnectStreamPool.bind(this)
);
}

Expand Down

0 comments on commit 7911491

Please sign in to comment.