Consume all pending events at once

This commit is contained in:
Ingvar Stepanyan
2021-07-26 13:25:51 +00:00
parent 92c785dc73
commit 36ed35192c
3 changed files with 19 additions and 11 deletions

View File

@@ -73,6 +73,7 @@ class App extends Component {
context.configToJS()
);
if (!isDebug) {
delete config.children.actions;
delete config.children.other;
}
this.setState({
@@ -83,10 +84,10 @@ class App extends Component {
await new Promise(resolve =>
requestIdleCallback(resolve, { timeout: 500 })
);
let hasPendingEvent = await this.connection.schedule(context =>
context.hasPendingEvent()
let hadEvents = await this.connection.schedule(context =>
context.consumeEvents()
);
if (hasPendingEvent) {
if (hadEvents) {
break;
}
}