@trivikr-test/property-provider
Advanced tools
Comparing version 3.170.0-es2016 to 3.170.0-es2017
@@ -1,2 +0,1 @@ | ||
import { __awaiter } from "tslib"; | ||
export const memoize = (provider, isExpired, requiresRefresh) => { | ||
@@ -7,3 +6,3 @@ let resolved; | ||
let isConstant = false; | ||
const coalesceProvider = () => __awaiter(void 0, void 0, void 0, function* () { | ||
const coalesceProvider = async () => { | ||
if (!pending) { | ||
@@ -13,3 +12,3 @@ pending = provider(); | ||
try { | ||
resolved = yield pending; | ||
resolved = await pending; | ||
hasResult = true; | ||
@@ -22,14 +21,14 @@ isConstant = false; | ||
return resolved; | ||
}); | ||
}; | ||
if (isExpired === undefined) { | ||
return (options) => __awaiter(void 0, void 0, void 0, function* () { | ||
return async (options) => { | ||
if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { | ||
resolved = yield coalesceProvider(); | ||
resolved = await coalesceProvider(); | ||
} | ||
return resolved; | ||
}); | ||
}; | ||
} | ||
return (options) => __awaiter(void 0, void 0, void 0, function* () { | ||
return async (options) => { | ||
if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { | ||
resolved = yield coalesceProvider(); | ||
resolved = await coalesceProvider(); | ||
} | ||
@@ -44,7 +43,7 @@ if (isConstant) { | ||
if (isExpired(resolved)) { | ||
yield coalesceProvider(); | ||
await coalesceProvider(); | ||
return resolved; | ||
} | ||
return resolved; | ||
}); | ||
}; | ||
}; |
{ | ||
"name": "@trivikr-test/property-provider", | ||
"version": "3.170.0-es2016", | ||
"version": "3.170.0-es2017", | ||
"scripts": { | ||
@@ -23,3 +23,3 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", | ||
"dependencies": { | ||
"@trivikr-test/types": "3.170.0-es2016", | ||
"@trivikr-test/types": "3.170.0-es2017", | ||
"tslib": "^2.3.1" | ||
@@ -26,0 +26,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
26974
359
+ Added@trivikr-test/types@3.170.0-es2017(transitive)
- Removed@trivikr-test/types@3.170.0-es2016(transitive)