@yhwh-script/event-bux 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -8,10 +8,10 @@ export const addEventListener = function (type, listener, context = undefined) {
8
8
  listeners.set(context, new Map()); // will be stored here
9
9
  }
10
10
  const contextListeners = listeners.get(context);
11
- if (!contextListeners.has(type)) { // eventName is not yet registered
11
+ if (!contextListeners.has(type)) { // type is not yet registered
12
12
  contextListeners.set(type, []);
13
13
  } // next push the handler to the WeakMap for the given context
14
- contextListeners.get(eventName).push(listener);
14
+ contextListeners.get(type).push(listener);
15
15
  } else { // default
16
16
  if (context) { // illegal context
17
17
  throw new Error("Syntax error.")
package/package.json CHANGED
@@ -22,5 +22,5 @@
22
22
  "url": "git+https://github.com/yhwh-script/event-bux.git"
23
23
  },
24
24
  "type": "module",
25
- "version": "1.0.4"
25
+ "version": "1.0.5"
26
26
  }