close #153 emit event when it being casted

This commit is contained in:
Yanzhen Yu
2019-12-08 16:45:21 +08:00
parent 3afff63970
commit 2d07b37701
2 changed files with 8 additions and 1 deletions

View File

@@ -131,7 +131,13 @@ export class Replayer {
if (isSync) {
castFn();
} else {
actions.push({ doAction: castFn, delay: this.getDelay(event) });
actions.push({
doAction: () => {
castFn();
this.emitter.emit(ReplayerEvents.EventCast, event);
},
delay: this.getDelay(event),
});
}
}
this.timer.addActions(actions);

View File

@@ -313,4 +313,5 @@ export enum ReplayerEvents {
SkipStart = 'skip-start',
SkipEnd = 'skip-end',
MouseInteraction = 'mouse-interaction',
EventCast = 'event-cast',
}