Skip to main content

Asynchronous Events

  • Chapter
  • First Online:
Practical Application Development with AppRun
  • 687 Accesses

Abstract

The JavaScript runtime executes event handlers one at a time in the event loop. If an event handler takes a long time to execute, the user interface appears to be unresponsive or frozen. This is because the JavaScript runtime must wait for the event handler to finish. The code execution is blocked while waiting. To avoid blocking the code execution, JavaScript uses a technique called asynchronous operations.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 29.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 37.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    For more information about the Promise object, please visit https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise .

  2. 2.

    For more information about async/await, please visit https://javascript.info/async-await .

  3. 3.

    For more information about the Fetch API, please visit https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch .

  4. 4.

    https://www.openweathermap.org/api

  5. 5.

    The Hacker News submission guidelines define the content type for the site. In general, content that can be “anything that gratifies one’s intellectual curiosity.” https://news.ycombinator.com/newsguidelines.html

  6. 6.

    For more information about the Hacker News API, please visit its GitHub project at https://github.com/HackerNews/API .

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Yiyi Sun

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Sun, Y. (2019). Asynchronous Events. In: Practical Application Development with AppRun. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4069-4_6

Download citation

Publish with us

Policies and ethics