@launchtray/tsyringe-async
Advanced tools
Comparing version 4.3.1 to 4.3.2
@@ -8,3 +8,3 @@ "use strict"; | ||
if (instance == undefined) { | ||
instance = yield factoryFunc(dependencyContainer); | ||
instance = factoryFunc(dependencyContainer); | ||
} | ||
@@ -11,0 +11,0 @@ return instance; |
@@ -11,6 +11,6 @@ "use strict"; | ||
if ((previousPredicate = currentPredicate)) { | ||
instance = yield dependencyContainer.resolve(trueConstructor); | ||
instance = dependencyContainer.resolve(trueConstructor); | ||
} | ||
else { | ||
instance = yield dependencyContainer.resolve(falseConstructor); | ||
instance = dependencyContainer.resolve(falseConstructor); | ||
} | ||
@@ -17,0 +17,0 @@ } |
@@ -6,3 +6,3 @@ import { __awaiter } from "tslib"; | ||
if (instance == undefined) { | ||
instance = yield factoryFunc(dependencyContainer); | ||
instance = factoryFunc(dependencyContainer); | ||
} | ||
@@ -9,0 +9,0 @@ return instance; |
@@ -9,6 +9,6 @@ import { __awaiter } from "tslib"; | ||
if ((previousPredicate = currentPredicate)) { | ||
instance = yield dependencyContainer.resolve(trueConstructor); | ||
instance = dependencyContainer.resolve(trueConstructor); | ||
} | ||
else { | ||
instance = yield dependencyContainer.resolve(falseConstructor); | ||
instance = dependencyContainer.resolve(falseConstructor); | ||
} | ||
@@ -15,0 +15,0 @@ } |
@@ -7,13 +7,8 @@ import { __awaiter, __generator } from "tslib"; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!(instance == undefined)) return [3, 2]; | ||
return [4, factoryFunc(dependencyContainer)]; | ||
case 1: | ||
instance = _a.sent(); | ||
_a.label = 2; | ||
case 2: return [2, instance]; | ||
if (instance == undefined) { | ||
instance = factoryFunc(dependencyContainer); | ||
} | ||
return [2, instance]; | ||
}); | ||
}); }; | ||
} |
@@ -10,19 +10,14 @@ import { __awaiter, __generator } from "tslib"; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
currentPredicate = predicate(dependencyContainer); | ||
if (!(!useCaching || previousPredicate !== currentPredicate)) return [3, 4]; | ||
if (!(previousPredicate = currentPredicate)) return [3, 2]; | ||
return [4, dependencyContainer.resolve(trueConstructor)]; | ||
case 1: | ||
instance = _a.sent(); | ||
return [3, 4]; | ||
case 2: return [4, dependencyContainer.resolve(falseConstructor)]; | ||
case 3: | ||
instance = _a.sent(); | ||
_a.label = 4; | ||
case 4: return [2, instance]; | ||
currentPredicate = predicate(dependencyContainer); | ||
if (!useCaching || previousPredicate !== currentPredicate) { | ||
if ((previousPredicate = currentPredicate)) { | ||
instance = dependencyContainer.resolve(trueConstructor); | ||
} | ||
else { | ||
instance = dependencyContainer.resolve(falseConstructor); | ||
} | ||
} | ||
return [2, instance]; | ||
}); | ||
}); }; | ||
} |
{ | ||
"name": "@launchtray/tsyringe-async", | ||
"version": "4.3.1", | ||
"version": "4.3.2", | ||
"description": "Lightweight dependency injection container for JavaScript/TypeScript, with asynchronous resolution", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
@@ -297,3 +297,3 @@ [![Travis](https://travis-ci.com/launchtray/tsyringe.svg?branch=launchtray-dev)](https://travis-ci.org/github/launchtray/tsyringe/) | ||
```typescript | ||
type FactoryFunction<T> = (dependencyContainer: DependencyContainer) => T; | ||
type FactoryFunction<T> = (dependencyContainer: DependencyContainer) => Promise<T>; | ||
``` | ||
@@ -300,0 +300,0 @@ |
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
113045
2250