Skip to content

Commit

Permalink
feat: wrap generator function to promise (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse authored Mar 31, 2017
1 parent e8d8056 commit fe1b4a3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use strict';

const mysql = require('mysql');
const util = require('util');
const mysql = require('mysql');
const wrap = require('co-wrap-all');
const Operator = require('./operator');
const RDSConnection = require('./connection');
const RDSTransaction = require('./transaction');
Expand Down Expand Up @@ -115,3 +116,5 @@ proto.end = function(callback) {
});
});
};

wrap(proto);
3 changes: 3 additions & 0 deletions lib/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

const util = require('util');
const wrap = require('co-wrap-all');
const Operator = require('./operator');

module.exports = RDSTransaction;
Expand Down Expand Up @@ -49,3 +50,5 @@ proto._check = function () {
throw new Error('transaction was commit or rollback');
}
};

wrap(proto);
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"lint": "jshint ."
},
"dependencies": {
"co-wrap-all": "^1.0.0",
"debug": "^2.2.0",
"mysql": "^2.10.2"
},
Expand Down

0 comments on commit fe1b4a3

Please sign in to comment.