Skip to content

Commit

Permalink
fix#6: remove response event
Browse files Browse the repository at this point in the history
  • Loading branch information
ImHype committed Nov 27, 2018
1 parent b777110 commit 312a34d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions lib/core/follower.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ module.exports = class Follower extends Base {
await this.client.ready();
await this.connectWithRetry();

this.client.on('response', (response) => {
const data = JSON.parse(response.data.toString());
const actions = ['connected'];
let action;

if (actions.includes(data.action)) {
action = data.action;
} else {
action = 'message';
}

this.emit(action, data);
});

this.client.on('request', (response) => {
const data = JSON.parse(response.data.toString());
const actions = ['excution', 'syncState'];
Expand Down
2 changes: 1 addition & 1 deletion lib/core/k-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ module.exports = class Client extends Base {
async _init() {
this.client.on('syncState', ({data}) => {
this.state = data;
})
});
}
}

0 comments on commit 312a34d

Please sign in to comment.