Allow .on to be chained directly after the constructor so that event handling for the first full snapshot can be added straight after constructor. See #216 (#416)
This commit is contained in:
@@ -194,14 +194,17 @@ export class Replayer {
|
||||
}, 0);
|
||||
}
|
||||
if (firstFullsnapshot) {
|
||||
this.rebuildFullSnapshot(
|
||||
firstFullsnapshot as fullSnapshotEvent & { timestamp: number },
|
||||
);
|
||||
setTimeout(() => {
|
||||
this.rebuildFullSnapshot(
|
||||
firstFullsnapshot as fullSnapshotEvent & { timestamp: number },
|
||||
);
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public on(event: string, handler: Handler) {
|
||||
this.emitter.on(event, handler);
|
||||
return this;
|
||||
}
|
||||
|
||||
public setConfig(config: Partial<playerConfig>) {
|
||||
|
||||
Reference in New Issue
Block a user