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:
parent
7082ff9bf8
commit
0e92f995c9
3 changed files with 45 additions and 51 deletions
|
@ -6,7 +6,7 @@ class MainTest {
|
|||
task: ReturnType<typeof getDocument> | undefined;
|
||||
|
||||
constructor(public file: string) {
|
||||
this.eventBus = new EventBus({});
|
||||
this.eventBus = new EventBus();
|
||||
}
|
||||
|
||||
loadPdf() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue