Skip to content

Commit 86e57bd

Browse files
committed
Converted simpleviewer.js to await/async
This reverts commit c001b17.
1 parent 9890f35 commit 86e57bd

File tree

2 files changed

+4
-75
lines changed

2 files changed

+4
-75
lines changed

examples/components/simpleviewer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@ const loadingTask = pdfjsLib.getDocument({
9292
cMapPacked: CMAP_PACKED,
9393
enableXfa: ENABLE_XFA,
9494
});
95-
loadingTask.promise.then(function (pdfDocument) {
95+
96+
(async function () {
97+
const pdfDocument = await loadingTask.promise;
9698
// Document loaded, specifying document for the viewer and
9799
// the (optional) linkService.
98100
pdfViewer.setDocument(pdfDocument);
99101

100102
pdfLinkService.setDocument(pdfDocument, null);
101-
});
103+
})();

package.json

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)