@chix/flow
Version:
46 lines • 1.83 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var common_1 = require("../common");
var node_1 = require("../events/node");
var util_1 = require("../util");
var nodebox_1 = require("./nodebox");
var ports_1 = require("./ports");
function $Shutdown(Base) {
return (function (_super) {
__extends(Shutdown$, _super);
function Shutdown$() {
return _super !== null && _super.apply(this, arguments) || this;
}
Shutdown$.prototype.shutdown = function () {
if (this.nodebox.on && this.nodebox.on.shutdown) {
this.nodebox.on.shutdown();
this.event(node_1.NodeEvents.SHUTDOWN, this.nodebox);
}
};
Shutdown$.prototype.hasShutdown = function () {
return this.nodebox.on && this.nodebox.on.shutdown;
};
return Shutdown$;
}(Base));
}
exports.$Shutdown = $Shutdown;
(function ($Shutdown) {
function create(Base) {
return util_1.mixin($Shutdown, common_1.$Event.create, nodebox_1.$Nodebox.create, ports_1.$Ports.create)(Base);
}
$Shutdown.create = create;
})($Shutdown = exports.$Shutdown || (exports.$Shutdown = {}));
//# sourceMappingURL=shutdown.js.map