@nxtedition/agent
Advanced tools
Comparing version 1.0.10 to 1.0.11
31
index.js
@@ -12,4 +12,2 @@ const objectHash = require('object-hash') | ||
const providers = new Map() | ||
module.exports = { | ||
@@ -49,29 +47,6 @@ spawn (query, prop) { | ||
return Observable | ||
.using( | ||
() => { | ||
let provider = providers.get(name) | ||
ds.record.set(name, { parent, description }) | ||
if (!provider) { | ||
provider = { | ||
unsubscribe: ds.record.provide(`${name}\\.query`, () => Observable.of({ parent, description })), | ||
refs: 0 | ||
} | ||
providers.set(name, provider) | ||
} | ||
provider.refs += 1 | ||
return { | ||
unsubscribe: () => { | ||
provider.refs -= 1 | ||
if (providers.refs === 0) { | ||
provider.unsubscribe() | ||
providers.delete(key) | ||
} | ||
} | ||
} | ||
}, | ||
() => ds.record.observe(name) | ||
) | ||
return ds.record | ||
.observe(name) | ||
.pluck(prop) | ||
@@ -78,0 +53,0 @@ .map(x => x || {}) |
{ | ||
"name": "@nxtedition/agent", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "author": "Robert Nagy <robert.nagy@boffins.se>", |
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
3449
49