[api-minor] Remove the getGlobalEventBus viewer functionality (PR 11631 follow-up)

The correct/intended way of working with the "viewer components" is by providing an `EventBus` instance upon initialization, and the `getGlobalEventBus` was only added for backwards compatibility.
Note, for example, that using `getGlobalEventBus` doesn't really work at all well with a use-case where there's *multiple* `PDFViewer` instances on a one page, since it may then be difficult/impossible to tell which viewer a particular event originated from.

All of the "viewer components" examples have been previously updated, such that there's no longer any code/examples which relies on the now removed `getGlobalEventBus` functionality.
This commit is contained in:
Jonas Jenwald 2020-02-27 15:02:03 +01:00
parent c12ea21c14
commit 7fd5f2dd61
8 changed files with 10 additions and 26 deletions

View file

@ -14,7 +14,6 @@
*/
import {
getGlobalEventBus,
isValidRotation,
parseQueryString,
waitOnEventOrTimeout,
@ -59,7 +58,7 @@ class PDFHistory {
*/
constructor({ linkService, eventBus }) {
this.linkService = linkService;
this.eventBus = eventBus || getGlobalEventBus();
this.eventBus = eventBus;
this._initialized = false;
this._fingerprint = "";