@furystack/inject
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -0,3 +1,5 @@ | ||
import { IDisposable } from "@sensenet/client-utils"; | ||
import { Constructable } from "./Types/Constructable"; | ||
export declare class Injector { | ||
export declare class Injector implements IDisposable { | ||
dispose(): Promise<void>; | ||
options: { | ||
@@ -4,0 +6,0 @@ parent: Injector; |
@@ -13,2 +13,12 @@ "use strict"; | ||
} | ||
async dispose() { | ||
/** */ | ||
const singletons = Array.from(this.cachedSingletons.entries()).map((e) => e[1]); | ||
const disposeRequests = singletons.map(async (s) => { | ||
if (s.dispose) { | ||
await s.dispose(); | ||
} | ||
}); | ||
await Promise.all(disposeRequests); | ||
} | ||
getCtorFromName(ctorName) { | ||
@@ -15,0 +25,0 @@ const ctor = this.options.scope[ctorName]; |
{ | ||
"name": "@furystack/inject", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Core FuryStack package", | ||
@@ -54,15 +54,15 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@sensenet/client-utils": "^1.1.0", | ||
"@types/node": "^10.11.7", | ||
"@sensenet/client-utils": "^1.2.1", | ||
"@types/node": "^10.12.5", | ||
"reflect-metadata": "^0.1.12" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.1.6", | ||
"@types/chai": "^4.1.7", | ||
"@types/mocha": "^5.2.5", | ||
"chai": "^4.2.0", | ||
"mocha": "^5.2.0", | ||
"nyc": "^11.9.0", | ||
"nyc": "^13.1.0", | ||
"rimraf": "^2.6.1", | ||
"tslint": "^5.11.0", | ||
"typescript": "^3.1.3" | ||
"typescript": "^3.1.6" | ||
}, | ||
@@ -69,0 +69,0 @@ "config": { |
# inject | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/furystack/inject.svg)](https://greenkeeper.io/) | ||
dependency injection provider for FuryStack |
@@ -0,4 +1,15 @@ | ||
import { IDisposable } from "@sensenet/client-utils"; | ||
import { Constructable } from "./Types/Constructable"; | ||
export class Injector { | ||
export class Injector implements IDisposable { | ||
public async dispose() { | ||
/** */ | ||
const singletons = Array.from(this.cachedSingletons.entries()).map((e) => e[1]); | ||
const disposeRequests = singletons.map(async (s) => { | ||
if (s.dispose) { | ||
await s.dispose(); | ||
} | ||
}); | ||
await Promise.all(disposeRequests); | ||
} | ||
@@ -5,0 +16,0 @@ public options: { parent: Injector, scope: any } = { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33144
210
6
Updated@types/node@^10.12.5