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);
|
}, 0);
|
||||||
}
|
}
|
||||||
if (firstFullsnapshot) {
|
if (firstFullsnapshot) {
|
||||||
this.rebuildFullSnapshot(
|
setTimeout(() => {
|
||||||
firstFullsnapshot as fullSnapshotEvent & { timestamp: number },
|
this.rebuildFullSnapshot(
|
||||||
);
|
firstFullsnapshot as fullSnapshotEvent & { timestamp: number },
|
||||||
|
);
|
||||||
|
}, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public on(event: string, handler: Handler) {
|
public on(event: string, handler: Handler) {
|
||||||
this.emitter.on(event, handler);
|
this.emitter.on(event, handler);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public setConfig(config: Partial<playerConfig>) {
|
public setConfig(config: Partial<playerConfig>) {
|
||||||
|
|||||||
Reference in New Issue
Block a user