node-firebird-driver
Version:
Firebird Driver Interfaces for Node.js
25 lines • 705 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AbstractEvents = void 0;
/** AbstractStatement implementation. */
class AbstractEvents {
constructor(attachment) {
this.attachment = attachment;
}
/** Cancel this events' resources. */
async cancel() {
this.check();
await this.internalCancel();
this.attachment?.events.delete(this);
this.attachment = undefined;
}
get isValid() {
return !!this.attachment;
}
check() {
if (!this.isValid)
throw new Error('Events are already cancelled.');
}
}
exports.AbstractEvents = AbstractEvents;
//# sourceMappingURL=events.js.map