File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ export class Replayer {
134
134
private mouseTail : HTMLCanvasElement | null = null ;
135
135
private tailPositions : Array < { x : number ; y : number } > = [ ] ;
136
136
137
- private emitter : Emitter = mitt ( ) ;
137
+ private emitter : Emitter = mitt ( ) as Emitter ;
138
138
139
139
private nextUserInteractionEvent : eventWithTime | null ;
140
140
@@ -331,6 +331,8 @@ export class Replayer {
331
331
this . applySelection ( this . lastSelectionData ) ;
332
332
this . lastSelectionData = null ;
333
333
}
334
+
335
+ this . emitter . emit ( ReplayerEvents . FlushEnd ) ;
334
336
} ) ;
335
337
this . emitter . on ( ReplayerEvents . PlayBack , ( ) => {
336
338
this . firstFullSnapshot = null ;
@@ -577,6 +579,7 @@ export class Replayer {
577
579
this . mediaManager . reset ( ) ;
578
580
this . config . root . removeChild ( this . wrapper ) ;
579
581
this . emitter . emit ( ReplayerEvents . Destroy ) ;
582
+ this . emitter . all . clear ( ) ;
580
583
}
581
584
582
585
public startLive ( baselineTime ?: number ) {
Original file line number Diff line number Diff line change @@ -651,6 +651,7 @@ export type Emitter = {
651
651
on ( type : string , handler : Handler ) : void ;
652
652
emit ( type : string , event ?: unknown ) : void ;
653
653
off ( type : string , handler : Handler ) : void ;
654
+ all : Map < string | symbol , Handler [ ] > ;
654
655
} ;
655
656
656
657
export type Arguments < T > = T extends ( ...payload : infer U ) => unknown
@@ -675,6 +676,7 @@ export enum ReplayerEvents {
675
676
EventCast = 'event-cast' ,
676
677
CustomEvent = 'custom-event' ,
677
678
Flush = 'flush' ,
679
+ FlushEnd = 'flush-end' ,
678
680
StateChange = 'state-change' ,
679
681
PlayBack = 'play-back' ,
680
682
Destroy = 'destroy' ,
You can’t perform that action at this time.
0 commit comments