fh-wfm-mediator
Advanced tools
Comparing version 0.1.0-rc3 to 0.1.0-rc4
@@ -7,3 +7,2 @@ 'use strict'; | ||
/** | ||
@@ -79,4 +78,4 @@ * A version of {@link once} that returns a Promise | ||
function unsubscribe() { | ||
self.remove(topics.done, subs.done.id); | ||
self.remove(topics.error, subs.error.id); | ||
self.remove(topics.done, subs.done); | ||
self.remove(topics.error, subs.error); | ||
} | ||
@@ -90,14 +89,15 @@ | ||
} | ||
// must setup subscriptions before publish | ||
var resultPromise = new Promise(function(resolve, reject) { | ||
subs.done = self.once(topics.done, resolve); | ||
subs.error = self.once(topics.error, reject); | ||
}); | ||
self.publish.apply(mediator, args); | ||
return new Promise(function(resolve, reject) { | ||
subs.done = self.once(topics.done, resolve); | ||
subs.error = mediator.once(topics.error, reject); | ||
}) | ||
return resultPromise | ||
.timeout(options.timeout, new Error('Mediator request timeout for topic ' + topic)) | ||
.tap(unsubscribe) | ||
.catch(function(e) { | ||
.finally(function() { | ||
unsubscribe(); | ||
// still forward the rejection to clients | ||
throw e; | ||
}); | ||
@@ -104,0 +104,0 @@ }; |
{ | ||
"name": "fh-wfm-mediator", | ||
"version": "0.1.0-rc3", | ||
"version": "0.1.0-rc4", | ||
"description": "An implementation of the mediator pattern for use with WFM", | ||
@@ -5,0 +5,0 @@ "main": "lib/angular/mediator-ng.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
37501
16
705