@robotlegsjs/core
Version:
An architecture-based IoC framework for JavaScript/TypeScript
89 lines • 3.32 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.LifecycleEvent = void 0;
/**
* Robotlegs object lifecycle event
*/
var LifecycleEvent = /** @class */ (function () {
/*============================================================================*/
/* Constructor */
/*============================================================================*/
/**
* Creates a Lifecycle Event
*
* @param type The event type
* @param error Optional error
*/
function LifecycleEvent(type, error) {
this._type = type;
this._error = error;
}
Object.defineProperty(LifecycleEvent.prototype, "error", {
/**
* Associated lifecycle error
*/
get: function () {
return this._error;
},
enumerable: false,
configurable: true
});
Object.defineProperty(LifecycleEvent.prototype, "type", {
/**
* The type of event
*/
get: function () {
return this._type;
},
enumerable: false,
configurable: true
});
Object.defineProperty(LifecycleEvent.prototype, "target", {
/**
* The target of event
*/
get: function () {
return this._target;
},
set: function (value) {
this._target = value;
},
enumerable: false,
configurable: true
});
/*============================================================================*/
/* Public Functions */
/*============================================================================*/
/**
* @inheritDoc
*/
LifecycleEvent.prototype.clone = function () {
return new LifecycleEvent(this.type, this.error);
};
/*============================================================================*/
/* Public Static Properties */
/*============================================================================*/
LifecycleEvent.ERROR = "_error";
LifecycleEvent.STATE_CHANGE = "stateChange";
LifecycleEvent.PRE_INITIALIZE = "preInitialize";
LifecycleEvent.INITIALIZE = "initialize";
LifecycleEvent.POST_INITIALIZE = "postInitialize";
LifecycleEvent.PRE_SUSPEND = "preSuspend";
LifecycleEvent.SUSPEND = "suspend";
LifecycleEvent.POST_SUSPEND = "postSuspend";
LifecycleEvent.PRE_RESUME = "preResume";
LifecycleEvent.RESUME = "resume";
LifecycleEvent.POST_RESUME = "postResume";
LifecycleEvent.PRE_DESTROY = "preDestroy";
LifecycleEvent.DESTROY = "destroy";
LifecycleEvent.POST_DESTROY = "postDestroy";
return LifecycleEvent;
}());
exports.LifecycleEvent = LifecycleEvent;
//# sourceMappingURL=LifecycleEvent.js.map