cradova 3.6.3 → 3.6.4
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.js +3 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -402,30 +402,14 @@ class Signal {
|
|
|
402
402
|
subscribe(eventName, comp) {
|
|
403
403
|
if (typeof Function === "function") {
|
|
404
404
|
if (Array.isArray(eventName)) {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
comp.pipes.set(event, this.pipe[event]);
|
|
409
|
-
comp.signals.set(event, this);
|
|
410
|
-
} else {
|
|
411
|
-
console.error(` ✘ Cradova err: ${event} is not a valid event for this Signal`);
|
|
412
|
-
}
|
|
413
|
-
if (this.subs[event]?.find((cmp) => cmp.id === comp.id)) {
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
if (!this.subs[event]) {
|
|
417
|
-
this.subs[event] = [comp];
|
|
418
|
-
} else {
|
|
419
|
-
this.subs[event].push(comp);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
405
|
+
eventName.forEach((en) => {
|
|
406
|
+
this.subscribe(en, comp);
|
|
407
|
+
});
|
|
422
408
|
return;
|
|
423
409
|
}
|
|
424
410
|
if (this.pipe[eventName]) {
|
|
425
411
|
comp.pipes.set(eventName, this.pipe[eventName]);
|
|
426
412
|
comp.signals.set(eventName, this);
|
|
427
|
-
} else {
|
|
428
|
-
console.error(` ✘ Cradova err: ${eventName} is not a valid event for this Signal`);
|
|
429
413
|
}
|
|
430
414
|
if (this.subs[eventName]?.find((cmp) => cmp.id === comp.id)) {
|
|
431
415
|
return;
|