@ukon1990/subscription-manager
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -26,6 +26,7 @@ "use strict"; | ||
add(emitter, fun, options) { | ||
const s = emitter.subscribe((data) => { | ||
const subscription = emitter | ||
.subscribe((data) => { | ||
if (options && options.terminateUponEvent) { | ||
if (s) { | ||
s.unsubscribe(); | ||
if (subscription) { | ||
subscription.unsubscribe(); | ||
} | ||
@@ -35,7 +36,7 @@ } | ||
}); | ||
this.list.push(s); | ||
this.list.push(subscription); | ||
if (options && options.id) { | ||
this.map.set(options.id, s); | ||
this.map.set(options.id, subscription); | ||
} | ||
return s; | ||
return subscription; | ||
} | ||
@@ -42,0 +43,0 @@ unsubscribe() { |
{ | ||
"name": "@ukon1990/subscription-manager", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# RXjs Subscription manager | ||
This does hopefully make subscription management less tedious, and helps clean up your code with less variables. | ||
You can install it like this:``npm i --save @ukon1990/subscription-manager`` | ||
Originally this code base were written before I found out about the | ||
@@ -5,0 +7,0 @@ basic ``subscription.add()``, but then you need to write more code manually. But i still find this method preferable, |
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
14509
197
113