wargerm 0.7.29 → 0.7.30
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.esm.js +19 -8
- package/dist/index.js +19 -8
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -433,7 +433,13 @@ var EventEmitter = /*#__PURE__*/_createClass(function EventEmitter() {
|
|
433
433
|
}
|
434
434
|
}
|
435
435
|
|
436
|
-
_this.subscriptions.
|
436
|
+
if (_this.subscriptions.has(event)) {
|
437
|
+
var _this$subscriptions$g;
|
438
|
+
|
439
|
+
(_this$subscriptions$g = _this.subscriptions.get(event)) === null || _this$subscriptions$g === void 0 ? void 0 : _this$subscriptions$g.push(subscription);
|
440
|
+
} else {
|
441
|
+
_this.subscriptions.set(event, [subscription]);
|
442
|
+
}
|
437
443
|
|
438
444
|
return function () {
|
439
445
|
_this.subscriptions.delete(event);
|
@@ -445,14 +451,19 @@ var EventEmitter = /*#__PURE__*/_createClass(function EventEmitter() {
|
|
445
451
|
if (typeof event === 'string' || typeof event === 'number') {
|
446
452
|
var subscriptionValuesCallback = _this.subscriptions.get(event);
|
447
453
|
|
448
|
-
|
449
|
-
args
|
450
|
-
|
454
|
+
if (subscriptionValuesCallback) {
|
455
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
456
|
+
args[_key - 1] = arguments[_key];
|
457
|
+
}
|
451
458
|
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
459
|
+
for (var i = 0; i < subscriptionValuesCallback.length; i++) {
|
460
|
+
var item = subscriptionValuesCallback[i];
|
461
|
+
item === null || item === void 0 ? void 0 : item({
|
462
|
+
event: event,
|
463
|
+
params: cloneDeep(args)
|
464
|
+
});
|
465
|
+
}
|
466
|
+
}
|
456
467
|
} else throw new TypeError('event must be string or number !');
|
457
468
|
};
|
458
469
|
|
package/dist/index.js
CHANGED
@@ -477,7 +477,13 @@ var EventEmitter = /*#__PURE__*/_createClass(function EventEmitter() {
|
|
477
477
|
}
|
478
478
|
}
|
479
479
|
|
480
|
-
_this.subscriptions.
|
480
|
+
if (_this.subscriptions.has(event)) {
|
481
|
+
var _this$subscriptions$g;
|
482
|
+
|
483
|
+
(_this$subscriptions$g = _this.subscriptions.get(event)) === null || _this$subscriptions$g === void 0 ? void 0 : _this$subscriptions$g.push(subscription);
|
484
|
+
} else {
|
485
|
+
_this.subscriptions.set(event, [subscription]);
|
486
|
+
}
|
481
487
|
|
482
488
|
return function () {
|
483
489
|
_this.subscriptions.delete(event);
|
@@ -489,14 +495,19 @@ var EventEmitter = /*#__PURE__*/_createClass(function EventEmitter() {
|
|
489
495
|
if (typeof event === 'string' || typeof event === 'number') {
|
490
496
|
var subscriptionValuesCallback = _this.subscriptions.get(event);
|
491
497
|
|
492
|
-
|
493
|
-
args
|
494
|
-
|
498
|
+
if (subscriptionValuesCallback) {
|
499
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
500
|
+
args[_key - 1] = arguments[_key];
|
501
|
+
}
|
495
502
|
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
503
|
+
for (var i = 0; i < subscriptionValuesCallback.length; i++) {
|
504
|
+
var item = subscriptionValuesCallback[i];
|
505
|
+
item === null || item === void 0 ? void 0 : item({
|
506
|
+
event: event,
|
507
|
+
params: lodashEs.cloneDeep(args)
|
508
|
+
});
|
509
|
+
}
|
510
|
+
}
|
500
511
|
} else throw new TypeError('event must be string or number !');
|
501
512
|
};
|
502
513
|
|