@teamnovu/kit-shopware-api-client 0.0.9 → 0.0.10

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/dist/index.mjs CHANGED
@@ -61,14 +61,8 @@ class m {
61
61
  if (!e || e.length === 0) return !0;
62
62
  const t = [...e];
63
63
  for (const s of t)
64
- if (!((n = s.signal) != null && n.aborted)) {
65
- try {
66
- typeof s.listener == "function" ? s.listener.call(this, r) : s.listener.handleEvent(r);
67
- } catch (a) {
68
- console.error("Error in event listener:", a);
69
- }
70
- if (s.options.once && this.removeEventListener(r.type, s.listener, s.options), r.cancelBubble) break;
71
- }
64
+ if (!((n = s.signal) != null && n.aborted) && (typeof s.listener == "function" ? s.listener.call(this, r) : s.listener.handleEvent(r), s.options.once && this.removeEventListener(r.type, s.listener, s.options), r.cancelBubble))
65
+ break;
72
66
  return !r.defaultPrevented;
73
67
  }
74
68
  normalizeOptions(r) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamnovu/kit-shopware-api-client",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "A client for the Shopware API",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",
@@ -1,3 +1,5 @@
1
+ // TODO: Move naming to hooks - deprecate event emitter
2
+
1
3
  interface EventListenerEntry {
2
4
  listener: EventListenerOrEventListenerObject
3
5
  options: AddEventListenerOptions
@@ -68,15 +70,10 @@ export class EventEmitter implements EventTarget {
68
70
  for (const entry of entriesCopy) {
69
71
  if (entry.signal?.aborted) continue
70
72
 
71
- try {
72
- if (typeof entry.listener === 'function') {
73
- entry.listener.call(this, event)
74
- } else {
75
- entry.listener.handleEvent(event)
76
- }
77
- } catch (error) {
78
- // In a real implementation, you might want to handle errors differently
79
- console.error('Error in event listener:', error)
73
+ if (typeof entry.listener === 'function') {
74
+ entry.listener.call(this, event)
75
+ } else {
76
+ entry.listener.handleEvent(event)
80
77
  }
81
78
 
82
79
  // Remove if 'once' option was set