Skip to content

Convert examples/image_decoders/jpeg_viewer.js to await/async #14123 #14167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

stbensonimoh
Copy link
Contributor

This converts examples/image_decoders/jpeg_viewers.js from using the old XMLHttpRequest to async/await.

This pull request

Convert examples/image_decoders/jpeg_viewers.js to await/async

Issue that this pull request solves

Closes: #14123

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

@stbensonimoh
Copy link
Contributor Author

@brendandahl and @marco-c Please help review. Thanks.

@stbensonimoh stbensonimoh force-pushed the convert-pdf-viewer-to-async-await branch from 8b9fa0d to 322ad53 Compare October 21, 2021 12:39
@stbensonimoh stbensonimoh force-pushed the convert-pdf-viewer-to-async-await branch from 322ad53 to 8f397e2 Compare October 21, 2021 15:52
Comment on lines 28 to 29
// Load the image data, and convert it to a Uint8Array.
//
Copy link
Collaborator

@Snuffleupagus Snuffleupagus Oct 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As was also mentioned in #14167 (comment), please move this comment to just above the const response = await fetch(JPEG_IMAGE);-line instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Done!

@stbensonimoh stbensonimoh force-pushed the convert-pdf-viewer-to-async-await branch from 8f397e2 to f263c86 Compare October 22, 2021 10:50
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, thank you.

@Snuffleupagus Snuffleupagus merged commit e788665 into mozilla:master Oct 22, 2021
@stbensonimoh
Copy link
Contributor Author

Thanks for your help and support too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert examples/image_decoders/jpeg_viewer.js to await/async
3 participants