diff --git a/src/core/animations/CoreAnimation.ts b/src/core/animations/CoreAnimation.ts index af78737d..72879711 100644 --- a/src/core/animations/CoreAnimation.ts +++ b/src/core/animations/CoreAnimation.ts @@ -326,6 +326,10 @@ export class CoreAnimation extends EventEmitter { } } + if (this.progress < 1) { + this.emit('tick', {}); + } + if (this.progress === 1) { this.emit('finished', {}); } diff --git a/src/core/animations/CoreAnimationController.ts b/src/core/animations/CoreAnimationController.ts index ff424a9e..187456b2 100644 --- a/src/core/animations/CoreAnimationController.ts +++ b/src/core/animations/CoreAnimationController.ts @@ -50,6 +50,7 @@ export class CoreAnimationController // Bind event handlers this.onAnimating = this.onAnimating.bind(this); this.onFinished = this.onFinished.bind(this); + this.onTick = this.onTick.bind(this); } start(): IAnimationController { @@ -93,6 +94,7 @@ export class CoreAnimationController // Hook up event listeners this.animation.once('finished', this.onFinished); this.animation.on('animating', this.onAnimating); + this.animation.on('tick', this.onTick); // Then register the animation this.manager.registerAnimation(this.animation); } @@ -103,6 +105,7 @@ export class CoreAnimationController // Then unhook event listeners this.animation.off('finished', this.onFinished); this.animation.off('animating', this.onAnimating); + this.animation.off('tick', this.onTick); } private makeStoppedPromise(): void { @@ -142,4 +145,8 @@ export class CoreAnimationController this.state = 'running'; this.emit('animating', this); } + + private onTick(this: CoreAnimationController): void { + this.emit('tick'); + } }