1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Re-factor the EventBus and isInAutomation handling (PR 11655 follow-up)

Rather than forcing the "regular" `EventBus` to check and handle `isInAutomation` for every `dispatch` call, we can take advantage of subclassing instead.
Hence this PR introduces a new `AutomationEventBus` class, which extends `EventBus`, and is used by the default viewer when `isInAutomation === true`.
This commit is contained in:
Jonas Jenwald 2021-09-17 18:17:40 +02:00
parent 7082ff9bf8
commit 0e92f995c9
3 changed files with 45 additions and 51 deletions

View file

@ -6,7 +6,7 @@ class MainTest {
task: ReturnType<typeof getDocument> | undefined;
constructor(public file: string) {
this.eventBus = new EventBus({});
this.eventBus = new EventBus();
}
loadPdf() {