@pisell/pisellos 0.0.222 → 0.0.223
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/solution/BookingTicket/index.js +2 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +4 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +26 -11
- package/lib/solution/BookingTicket/index.js +1 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +14 -2
- package/package.json +1 -1
|
@@ -651,6 +651,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
651
651
|
(_this$store$order = this.store.order) === null || _this$store$order === void 0 || _this$store$order.destroy();
|
|
652
652
|
this.core.effects.offByModuleDestroy(this.name);
|
|
653
653
|
this.core.unregisterModule(this);
|
|
654
|
+
// 清除所有的监听
|
|
655
|
+
this.scan.removeAllListeners();
|
|
654
656
|
// 清除scan数据内存缓存
|
|
655
657
|
scanCache.clear();
|
|
656
658
|
}
|
|
@@ -82,10 +82,25 @@ var Scan = /*#__PURE__*/function () {
|
|
|
82
82
|
value: function removeListener(event) {
|
|
83
83
|
var _this$listenerConfig$;
|
|
84
84
|
watch.unsubscribe(this.watchKey, event);
|
|
85
|
-
(_this$listenerConfig$ = this.listenerConfig.get(event.key)) === null || _this$listenerConfig$ === void 0 || _this$listenerConfig$.task
|
|
85
|
+
(_this$listenerConfig$ = this.listenerConfig.get(event.key)) === null || _this$listenerConfig$ === void 0 || (_this$listenerConfig$ = _this$listenerConfig$.task) === null || _this$listenerConfig$ === void 0 || _this$listenerConfig$.clear();
|
|
86
86
|
this.listenerConfig.delete(event.key);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* 移除所有监听
|
|
91
|
+
*/
|
|
92
|
+
}, {
|
|
93
|
+
key: "removeAllListeners",
|
|
94
|
+
value: function removeAllListeners() {
|
|
95
|
+
var _this$listenerConfig, _this$listenerConfig$2, _this$listenerConfig2, _this$listenerConfig3;
|
|
96
|
+
watch.clearEvent(this.watchKey);
|
|
97
|
+
(_this$listenerConfig = this.listenerConfig) === null || _this$listenerConfig === void 0 || (_this$listenerConfig$2 = _this$listenerConfig.forEach) === null || _this$listenerConfig$2 === void 0 || _this$listenerConfig$2.call(_this$listenerConfig, function (item) {
|
|
98
|
+
var _item$task;
|
|
99
|
+
item === null || item === void 0 || (_item$task = item.task) === null || _item$task === void 0 || _item$task.clear();
|
|
100
|
+
});
|
|
101
|
+
(_this$listenerConfig2 = this.listenerConfig) === null || _this$listenerConfig2 === void 0 || (_this$listenerConfig3 = _this$listenerConfig2.clear) === null || _this$listenerConfig3 === void 0 || _this$listenerConfig3.call(_this$listenerConfig2);
|
|
102
|
+
}
|
|
103
|
+
|
|
89
104
|
/**
|
|
90
105
|
* 启用所有监听
|
|
91
106
|
*/
|
|
@@ -101,12 +116,12 @@ var Scan = /*#__PURE__*/function () {
|
|
|
101
116
|
}, {
|
|
102
117
|
key: "disableAllListeners",
|
|
103
118
|
value: function disableAllListeners() {
|
|
104
|
-
var _this$
|
|
119
|
+
var _this$listenerConfig4, _this$listenerConfig5;
|
|
105
120
|
watch.disabledAllEventByWatchKey(this.watchKey);
|
|
106
121
|
// 清空任务
|
|
107
|
-
(_this$
|
|
108
|
-
var _item$
|
|
109
|
-
item === null || item === void 0 || (_item$
|
|
122
|
+
(_this$listenerConfig4 = this.listenerConfig) === null || _this$listenerConfig4 === void 0 || (_this$listenerConfig5 = _this$listenerConfig4.forEach) === null || _this$listenerConfig5 === void 0 || _this$listenerConfig5.call(_this$listenerConfig4, function (item) {
|
|
123
|
+
var _item$task2;
|
|
124
|
+
item === null || item === void 0 || (_item$task2 = item.task) === null || _item$task2 === void 0 || _item$task2.clearTaskQueue();
|
|
110
125
|
});
|
|
111
126
|
}
|
|
112
127
|
|
|
@@ -121,10 +136,10 @@ var Scan = /*#__PURE__*/function () {
|
|
|
121
136
|
var _this$listenerConfig$3;
|
|
122
137
|
(_this$listenerConfig$3 = this.listenerConfig.get(eventKey)) === null || _this$listenerConfig$3 === void 0 || _this$listenerConfig$3.task.clearTaskQueue();
|
|
123
138
|
} else {
|
|
124
|
-
var _this$
|
|
125
|
-
(_this$
|
|
126
|
-
var _item$
|
|
127
|
-
item === null || item === void 0 || (_item$
|
|
139
|
+
var _this$listenerConfig6, _this$listenerConfig7;
|
|
140
|
+
(_this$listenerConfig6 = this.listenerConfig) === null || _this$listenerConfig6 === void 0 || (_this$listenerConfig7 = _this$listenerConfig6.forEach) === null || _this$listenerConfig7 === void 0 || _this$listenerConfig7.call(_this$listenerConfig6, function (item) {
|
|
141
|
+
var _item$task3;
|
|
142
|
+
item === null || item === void 0 || (_item$task3 = item.task) === null || _item$task3 === void 0 || _item$task3.clearTaskQueue();
|
|
128
143
|
});
|
|
129
144
|
}
|
|
130
145
|
}
|
|
@@ -159,8 +174,8 @@ var Scan = /*#__PURE__*/function () {
|
|
|
159
174
|
}, {
|
|
160
175
|
key: "getListenerConfig",
|
|
161
176
|
value: function getListenerConfig(eventKey) {
|
|
162
|
-
var _this$
|
|
163
|
-
return (_this$
|
|
177
|
+
var _this$listenerConfig8;
|
|
178
|
+
return (_this$listenerConfig8 = this.listenerConfig) === null || _this$listenerConfig8 === void 0 ? void 0 : _this$listenerConfig8.get(eventKey);
|
|
164
179
|
}
|
|
165
180
|
|
|
166
181
|
/**
|
|
@@ -387,6 +387,7 @@ var BookingTicketImpl = class extends import_BaseModule.BaseModule {
|
|
|
387
387
|
(_e = this.store.order) == null ? void 0 : _e.destroy();
|
|
388
388
|
this.core.effects.offByModuleDestroy(this.name);
|
|
389
389
|
this.core.unregisterModule(this);
|
|
390
|
+
this.scan.removeAllListeners();
|
|
390
391
|
import_scanCache.default.clear();
|
|
391
392
|
}
|
|
392
393
|
};
|
|
@@ -80,11 +80,23 @@ var Scan = class {
|
|
|
80
80
|
* @param event 事件
|
|
81
81
|
*/
|
|
82
82
|
removeListener(event) {
|
|
83
|
-
var _a;
|
|
83
|
+
var _a, _b;
|
|
84
84
|
import_watch.default.unsubscribe(this.watchKey, event);
|
|
85
|
-
(_a = this.listenerConfig.get(event.key)) == null ? void 0 : _a.task.clear();
|
|
85
|
+
(_b = (_a = this.listenerConfig.get(event.key)) == null ? void 0 : _a.task) == null ? void 0 : _b.clear();
|
|
86
86
|
this.listenerConfig.delete(event.key);
|
|
87
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* 移除所有监听
|
|
90
|
+
*/
|
|
91
|
+
removeAllListeners() {
|
|
92
|
+
var _a, _b, _c, _d;
|
|
93
|
+
import_watch.default.clearEvent(this.watchKey);
|
|
94
|
+
(_b = (_a = this.listenerConfig) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (item) => {
|
|
95
|
+
var _a2;
|
|
96
|
+
(_a2 = item == null ? void 0 : item.task) == null ? void 0 : _a2.clear();
|
|
97
|
+
});
|
|
98
|
+
(_d = (_c = this.listenerConfig) == null ? void 0 : _c.clear) == null ? void 0 : _d.call(_c);
|
|
99
|
+
}
|
|
88
100
|
/**
|
|
89
101
|
* 启用所有监听
|
|
90
102
|
*/
|