@injex/core
Advanced tools
Comparing version 2.0.0-alpha.3 to 2.0.0-alpha.4
@@ -1,2 +0,2 @@ | ||
import { IConstructor } from "@injex/stdlib"; | ||
import { IConstructor, Logger } from "@injex/stdlib"; | ||
import { IModule, ModuleName, IInjexHooks, IContainerConfig } from "./interfaces"; | ||
@@ -10,2 +10,3 @@ export default abstract class InjexContainer<T extends IContainerConfig> { | ||
hooks: IInjexHooks; | ||
get logger(): Logger; | ||
/** | ||
@@ -12,0 +13,0 @@ * Parse and extend with default values configuration |
@@ -18,2 +18,9 @@ "use strict"; | ||
} | ||
Object.defineProperty(InjexContainer.prototype, "logger", { | ||
get: function () { | ||
return this._logger; | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
InjexContainer.create = function (config) { | ||
@@ -41,8 +48,11 @@ throw new Error("Static method create not implemented."); | ||
_a.sent(); | ||
this.hooks.bootstrapRun.call(); | ||
return [4 /*yield*/, (bootstrapModule === null || bootstrapModule === void 0 ? void 0 : bootstrapModule.run())]; | ||
case 4: | ||
_a.sent(); | ||
this.hooks.bootstrapComplete.call(); | ||
return [3 /*break*/, 6]; | ||
case 5: | ||
e_1 = _a.sent(); | ||
this.hooks.bootstrapError.call(e_1); | ||
if (bootstrapModule === null || bootstrapModule === void 0 ? void 0 : bootstrapModule.didCatch) { | ||
@@ -101,3 +111,6 @@ bootstrapModule === null || bootstrapModule === void 0 ? void 0 : bootstrapModule.didCatch(e_1); | ||
afterCreateModules: new stdlib_1.Hook(), | ||
berforeCreateInstance: new stdlib_1.Hook(), | ||
beforeCreateInstance: new stdlib_1.Hook(), | ||
bootstrapRun: new stdlib_1.Hook(), | ||
bootstrapError: new stdlib_1.Hook(), | ||
bootstrapComplete: new stdlib_1.Hook(), | ||
}; | ||
@@ -240,3 +253,3 @@ }; | ||
if (args === void 0) { args = []; } | ||
this.hooks.berforeCreateInstance.call(construct, args); | ||
this.hooks.beforeCreateInstance.call(construct, args); | ||
return new (construct.bind.apply(construct, tslib_1.__spreadArrays([void 0], args)))(); | ||
@@ -243,0 +256,0 @@ }; |
@@ -41,3 +41,6 @@ import { Hook, IConstructor, LogLevel } from "@injex/stdlib"; | ||
afterCreateModules: Hook; | ||
berforeCreateInstance: Hook<[IConstructor, any[]]>; | ||
beforeCreateInstance: Hook<[IConstructor, any[]]>; | ||
bootstrapRun: Hook; | ||
bootstrapError: Hook<[Error]>; | ||
bootstrapComplete: Hook; | ||
} | ||
@@ -44,0 +47,0 @@ export interface IContainerConfig { |
{ | ||
"name": "@injex/core", | ||
"version": "2.0.0-alpha.3", | ||
"version": "2.0.0-alpha.4", | ||
"description": "Simple, Decorated, Pluggable dependency-injection framework for TypeScript apps", | ||
@@ -46,3 +46,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@injex/stdlib": "^2.0.0-alpha.3", | ||
"@injex/stdlib": "^2.0.0-alpha.4", | ||
"tslib": "^2.0.1" | ||
@@ -56,3 +56,3 @@ }, | ||
}, | ||
"gitHead": "ddba4fbd07877f34650f8435636dc3009e7255c8" | ||
"gitHead": "8654c3279900f3686b905a3e72ebf8b75f694ecc" | ||
} |
Sorry, the diff of this file is not supported yet
45152
659
Updated@injex/stdlib@^2.0.0-alpha.4