@superhero/eventflow-spoke 4.4.8 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/consume.js CHANGED
@@ -45,9 +45,12 @@ export default class ConsumeService
45
45
  {
46
46
  const
47
47
  service = this.#locator.locate(domain),
48
- consumer = this.#consumer.bind(this, service)
48
+ consumer = this.#consumer.bind(this, service),
49
+ names = Array.isArray(consumerMap[domain])
50
+ ? consumerMap[domain]
51
+ :[consumerMap[domain]]
49
52
 
50
- for(const name of consumerMap[domain])
53
+ for(const name of names)
51
54
  {
52
55
  await this.#spoke.consume(domain, name, consumer)
53
56
  }
package/index.js CHANGED
@@ -152,6 +152,7 @@ export default class Spoke
152
152
  for(const name of subscriptions[domain])
153
153
  {
154
154
  this.channel.transmit(hub, [ 'subscribe', domain, name ])
155
+ this.log.info`${hubID} subscribes to: ${domain} › ${name}`
155
156
  }
156
157
  }
157
158
  }
@@ -63,9 +63,12 @@ export default class ListenersManager
63
63
  throw error
64
64
  }
65
65
  },
66
- get : (target, domain) => this.#map.get(domain) ?? target.lazyload(domain),
66
+ deleteProperty : (_, domain) => this.#map.delete(domain),
67
67
  has : (_, domain) => this.#map.has(domain),
68
- deleteProperty : (_, domain) => this.#map.delete(domain)
68
+ get : (target, domain) => this.#map.get(domain)
69
+ ?? domain in target
70
+ ? target[domain]
71
+ : target.lazyload(domain)
69
72
  })
70
73
  }
71
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superhero/eventflow-spoke",
3
- "version": "4.4.8",
3
+ "version": "4.5.0",
4
4
  "description": "Eventflow spoke is the client component in the eventflow ecosystem.",
5
5
  "keywords": [
6
6
  "eventflow",