Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@injex/core

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@injex/core - npm Package Compare versions

Comparing version 3.2.1 to 3.3.0

18

lib/injex.js

@@ -288,5 +288,23 @@ "use strict";

InjexContainer.prototype._invokeModuleReadyMethod = function (module, metadata) {
var _this = this;
if (this.config.asyncModuleInit) {
return new Promise(function (resolve) {
setTimeout(function () {
var promise = _this._invokeMetadataModuleMethod(module, metadata, 'readyMethod');
stdlib_1.isPromise(promise) ? promise.then(resolve) : resolve();
});
});
}
return this._invokeMetadataModuleMethod(module, metadata, 'readyMethod');
};
InjexContainer.prototype._invokeModuleInitMethod = function (module, metadata) {
var _this = this;
if (this.config.asyncModuleInit) {
return new Promise(function (resolve) {
setTimeout(function () {
var promise = _this._invokeMetadataModuleMethod(module, metadata, 'initMethod', _this._onInitModuleError);
stdlib_1.isPromise(promise) ? promise.then(resolve) : resolve();
});
});
}
return this._invokeMetadataModuleMethod(module, metadata, 'initMethod', this._onInitModuleError);

@@ -293,0 +311,0 @@ };

@@ -60,2 +60,10 @@ import { Hook, IConstructor, LogLevel } from "@injex/stdlib";

plugins?: IInjexPlugin[];
/**
* Separate each module @init() to a separate task to prevent
* long task while initializing container modules.
*
* @type Boolean
* @default false
*/
asyncModuleInit?: boolean;
}

@@ -62,0 +70,0 @@ export interface ILazyModule<T> {

6

package.json
{
"name": "@injex/core",
"version": "3.2.1",
"version": "3.3.0",
"description": "Simple, Decorated, Pluggable dependency-injection framework for TypeScript apps",

@@ -47,3 +47,3 @@ "keywords": [

"dependencies": {
"@injex/stdlib": "^3.2.1"
"@injex/stdlib": "^3.3.0"
},

@@ -57,3 +57,3 @@ "devDependencies": {

},
"gitHead": "92c874b3a2e9e57ac96214f96a5ce4f5b54a7d9d"
"gitHead": "7a0c48970c4204a5db67fdbe85e37609469f581a"
}

@@ -315,2 +315,11 @@ import { Hook, IConstructor, isFunction, isPromise, Logger } from "@injex/stdlib";

private _invokeModuleReadyMethod(module: any, metadata: IDefinitionMetadata): Promise<any> | any {
if (this.config.asyncModuleInit) {
return new Promise<void>((resolve) => {
setTimeout(() => {
const promise = this._invokeMetadataModuleMethod(module, metadata, 'readyMethod');
isPromise(promise) ? promise.then(resolve) : resolve();
});
});
}
return this._invokeMetadataModuleMethod(module, metadata, 'readyMethod');

@@ -320,2 +329,11 @@ }

private _invokeModuleInitMethod(module: any, metadata: IDefinitionMetadata): Promise<any> | any {
if (this.config.asyncModuleInit) {
return new Promise<void>((resolve) => {
setTimeout(() => {
const promise = this._invokeMetadataModuleMethod(module, metadata, 'initMethod', this._onInitModuleError);
isPromise(promise) ? promise.then(resolve) : resolve();
});
});
}
return this._invokeMetadataModuleMethod(module, metadata, 'initMethod', this._onInitModuleError);

@@ -322,0 +340,0 @@ }

@@ -70,2 +70,11 @@ import { Hook, IConstructor, LogLevel } from "@injex/stdlib";

plugins?: IInjexPlugin[];
/**
* Separate each module @init() to a separate task to prevent
* long task while initializing container modules.
*
* @type Boolean
* @default false
*/
asyncModuleInit?: boolean;
}

@@ -72,0 +81,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc