Skip to content

Commit

Permalink
Use promise for closeClient() and remove EventEmitter signals
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafostar committed Sep 13, 2019
1 parent 13aac09 commit d0474cf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ module.exports = class Client

_closeClient()
{
this.enabled = false;
if(this.client) this.client.kill();
return new Promise((resolve, reject) =>
{
this.enabled = false;
if(this.client) this.client.kill();

this.cec.removeAllListeners();
this.cec = null;

resolve(true);
});
}

_scanDevices()
Expand Down

0 comments on commit d0474cf

Please sign in to comment.