@leafer/event 1.2.1 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/event",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "@leafer/event",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/decorator": "1.2.1",
26
- "@leafer/math": "1.2.1",
27
- "@leafer/platform": "1.2.1"
25
+ "@leafer/decorator": "1.3.0",
26
+ "@leafer/math": "1.3.0",
27
+ "@leafer/platform": "1.3.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@leafer/interface": "1.2.1"
30
+ "@leafer/interface": "1.3.0"
31
31
  }
32
32
  }
package/src/Eventer.ts CHANGED
@@ -122,13 +122,14 @@ export class Eventer implements IEventer {
122
122
  if (list) {
123
123
  let item: IEventListenerItem
124
124
  for (let i = 0, len = list.length; i < len; i++) {
125
- item = list[i]
126
- item.listener(event)
127
- if (item.once) {
128
- this.off(type, item.listener, capture)
129
- i--, len--
125
+ if (item = list[i]) { // 防止 list 变化造成的空值
126
+ item.listener(event)
127
+ if (item.once) {
128
+ this.off(type, item.listener, capture)
129
+ i--, len--
130
+ }
131
+ if (event && event.isStopNow) break
130
132
  }
131
- if (event && (event as IEvent).isStopNow) break
132
133
  }
133
134
  }
134
135
 
@@ -5,8 +5,6 @@ import { Event } from './Event'
5
5
 
6
6
  export class LayoutEvent extends Event implements ILayoutEvent {
7
7
 
8
- static CHECK_UPDATE = 'layout.check_update'
9
-
10
8
  static REQUEST = 'layout.request'
11
9
 
12
10
  static START = 'layout.start'
package/types/index.d.ts CHANGED
@@ -68,7 +68,6 @@ declare class WatchEvent extends Event implements IWatchEvent {
68
68
  }
69
69
 
70
70
  declare class LayoutEvent extends Event implements ILayoutEvent {
71
- static CHECK_UPDATE: string;
72
71
  static REQUEST: string;
73
72
  static START: string;
74
73
  static BEFORE: string;