Skip to content

Commit 4c463c6

Browse files
committed
Converted simpleviewer.js to await/async
1 parent a37bc60 commit 4c463c6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/components/simpleviewer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ const loadingTask = pdfjsLib.getDocument({
8888
cMapPacked: CMAP_PACKED,
8989
enableXfa: ENABLE_XFA,
9090
});
91-
loadingTask.promise.then(function (pdfDocument) {
91+
(async function () {
92+
const pdfDocument = await loadingTask.promise;
9293
// Document loaded, specifying document for the viewer and
9394
// the (optional) linkService.
9495
pdfViewer.setDocument(pdfDocument);
9596

9697
pdfLinkService.setDocument(pdfDocument, null);
97-
});
98+
})();

0 commit comments

Comments
 (0)