feat: Actions::tickingPromise

This commit is contained in:
cha0s 2019-09-08 07:39:55 -05:00
parent 708c4fe25d
commit 3296f3d196

View File

@ -113,10 +113,15 @@ export class Actions extends decorate(Traversals) {
}
serial(context) {
// Do a "dry" tick.
// Immediate tick. Maybe we can avoid a promise?
this.tick(context, 0);
// If it's pending, we have to return a ticking promise.
if (this.pending) {
return this.tickingPromise(context);
}
}
tickingPromise(context) {
return new TickingPromise(
(resolve) => {
this.once('actionsFinished', () => {
@ -128,6 +133,5 @@ export class Actions extends decorate(Traversals) {
},
);
}
}
}