feat: add isactive check for transaction (#164)

This commit is contained in:
Janny 2020-01-20 15:33:38 -05:00 committed by GitHub
parent 61766bb0da
commit b294519787
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -134,3 +134,10 @@ Transaction.begin = function(connector, options, cb) {
}); });
if (cb.promise) return cb.promise; if (cb.promise) return cb.promise;
}; };
/**
* Check whether a transaction has an active connection.
*/
Transaction.prototype.isActive = function() {
return !!this.connection;
};