@stoplight/lifecycle
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -62,5 +62,20 @@ "use strict"; | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
for (const activatable of this.activatables) { | ||
yield activatable.activate(); | ||
const activated = []; | ||
try { | ||
for (const activatable of this.activatables) { | ||
yield activatable.activate(); | ||
activated.push(activatable); | ||
} | ||
} | ||
catch (e) { | ||
activated.reverse(); | ||
for (const activatable of activated) { | ||
try { | ||
yield activatable.deactivate(); | ||
} | ||
catch (_) { | ||
} | ||
} | ||
throw e; | ||
} | ||
}); | ||
@@ -67,0 +82,0 @@ } |
{ | ||
"name": "@stoplight/lifecycle", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Event and disposable helpers.", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
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
30125
294