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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
For more information about the Promise object, please visit https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise .
- 2.
For more information about async/await, please visit https://javascript.info/async-await .
- 3.
For more information about the Fetch API, please visit https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch .
- 4.
- 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.
For more information about the Hacker News API, please visit its GitHub project at https://github.com/HackerNews/API .
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Yiyi Sun
About this chapter
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
DOI: https://doi.org/10.1007/978-1-4842-4069-4_6
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-4068-7
Online ISBN: 978-1-4842-4069-4
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books