Skip to content

Commit

Permalink
refactor: create alias method instead of modify prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
wallet77 committed Feb 27, 2018
1 parent 047aa49 commit 6d8f0df
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ class API {
});
};

/**
* Alias on disconnect
* @param cb
*/
close (cb) {
this.disconnect(cb);
}

/**
* Launch modules
*
Expand Down Expand Up @@ -617,6 +625,10 @@ class API {
});
}

kill (cb) {
this.killDaemon(cb);
}

/////////////////////
// Private methods //
/////////////////////
Expand Down Expand Up @@ -1653,9 +1665,6 @@ class API {
}
};

API.prototype.close = API.prototype.disconnect;
API.prototype.kill = API.prototype.killDaemon;


//////////////////////////
// Load all API methods //
Expand Down

0 comments on commit 6d8f0df

Please sign in to comment.