neo.mjs 4.0.36 → 4.0.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "4.0.36",
3
+ "version": "4.0.37",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -111,7 +111,12 @@ class Observable extends Base {
111
111
  eventConfig.fn = eventConfig.scope[eventConfig.fn];
112
112
  }
113
113
 
114
- eventConfig.fn.apply(eventConfig.scope || me, eventConfig.data ? args.concat(eventConfig.data) : args);
114
+ // remove the listener, in case the scope no longer exists
115
+ if (eventConfig.scope && !eventConfig.scope.id) {
116
+ listeners[name].splice(i, 1);
117
+ } else {
118
+ eventConfig.fn.apply(eventConfig.scope || me, eventConfig.data ? args.concat(eventConfig.data) : args);
119
+ }
115
120
  }
116
121
  }
117
122
  }
@@ -95,9 +95,7 @@ class NeoArray extends Base {
95
95
  items.forEach(item => {
96
96
  index = arr.indexOf(item);
97
97
 
98
- if (index > -1) {
99
- arr.splice(index, 1);
100
- }
98
+ index > -1 && arr.splice(index, 1);
101
99
  });
102
100
  }
103
101