This commit is contained in:
zadam
2020-01-24 20:15:53 +01:00
parent 606d5afcab
commit ba500a3a80
7 changed files with 48 additions and 26 deletions

View File

@@ -22,12 +22,10 @@ export default class Component {
}
if (propagateToChildren) {
for (const child of this.children) {
let promise = child.eventReceived(name, data, sync);
const promise = this.triggerChildren(name, data, sync);
if (sync) {
await promise;
}
if (sync) {
await promise;
}
}
}
@@ -35,4 +33,14 @@ export default class Component {
trigger(name, data, sync = false) {
this.appContext.trigger(name, data, sync);
}
async triggerChildren(name, data, sync = false) {
for (const child of this.children) {
let promise = child.eventReceived(name, data, sync);
if (sync) {
await promise;
}
}
}
}