@robotlegsjs/core
Version:
An architecture-based IoC framework for JavaScript/TypeScript
56 lines • 2.67 kB
JavaScript
;
// ------------------------------------------------------------------------------
// Copyright (c) 2017-present, RobotlegsJS. All Rights Reserved.
//
// NOTICE: You are permitted to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
// ------------------------------------------------------------------------------
Object.defineProperty(exports, "__esModule", { value: true });
exports.LifecycleEventRelay = void 0;
var LifecycleEvent_1 = require("../../../framework/api/LifecycleEvent");
var EventRelay_1 = require("./EventRelay");
/**
* @private
*/
var LifecycleEventRelay = /** @class */ (function () {
/*============================================================================*/
/* Constructor */
/*============================================================================*/
/**
* @private
*/
function LifecycleEventRelay(source, destination) {
this._relay = new EventRelay_1.EventRelay(source, destination, LifecycleEventRelay._TYPES).start();
}
/*============================================================================*/
/* Public Functions */
/*============================================================================*/
/**
* @private
*/
LifecycleEventRelay.prototype.destroy = function () {
this._relay.stop();
this._relay = null;
};
/*============================================================================*/
/* Private Static Properties */
/*============================================================================*/
LifecycleEventRelay._TYPES = [
LifecycleEvent_1.LifecycleEvent.STATE_CHANGE,
LifecycleEvent_1.LifecycleEvent.PRE_INITIALIZE,
LifecycleEvent_1.LifecycleEvent.INITIALIZE,
LifecycleEvent_1.LifecycleEvent.POST_INITIALIZE,
LifecycleEvent_1.LifecycleEvent.PRE_SUSPEND,
LifecycleEvent_1.LifecycleEvent.SUSPEND,
LifecycleEvent_1.LifecycleEvent.POST_SUSPEND,
LifecycleEvent_1.LifecycleEvent.PRE_RESUME,
LifecycleEvent_1.LifecycleEvent.RESUME,
LifecycleEvent_1.LifecycleEvent.POST_RESUME,
LifecycleEvent_1.LifecycleEvent.PRE_DESTROY,
LifecycleEvent_1.LifecycleEvent.DESTROY,
LifecycleEvent_1.LifecycleEvent.POST_DESTROY
];
return LifecycleEventRelay;
}());
exports.LifecycleEventRelay = LifecycleEventRelay;
//# sourceMappingURL=LifecycleEventRelay.js.map