Magzter Gold (Sitewide CA)
The Web Design Book (Digital)

The Web Design Book (Digital)

1 Issue, The Web Design Book Vol 6

Also available on
Zinio Unlimited logo
1-month free trial

Get unlimited access to this article, this issue, + back issues & 5,000+ other magazines.

Renews at just $8.99/month after trial.

Cancel anytime.
Learn more

Manage JS with asynchronous tasks

Promise objects aim to remove redundant and/or excessive callback functions from background tasks
Manage JS with asynchronous tasks
DOWNLOAD TUTORIAL FILES www.filesilo.co.uk/bks-894 Using callback functions is a sure-fire way to induce JavaScript bloat: we know of some code examples where the accomplishment of a single task requires the presence of a dozen callbacks. Furthermore, callbacks are not a catch-all solution for event handling. As the use of exceptions spreads over to JavaScript, keeping an eye on the various error sources becomes tedious pretty quickly. Even though Promises have not been fully formalised at the time of writing, they nevertheless provide a fascinating alternative to callbacks. In principle, a Promise is but a state machine object whose state reflects the situation of the task at hand. Deploying Promises significantly reduces the efforts involved in callback and event handling. When done right, core functions can be observed at a glance.…
You're reading a preview of
The Web Design Book (Digital) - 1 Issue, The Web Design Book Vol 6

DiscountMags is a licensed distributor (not a publisher) of the above content and Publication through Zinio LLC. Accordingly, we have no editorial control over the Publications. Any opinions, advice, statements, services, offers or other information or content expressed or made available by third parties, including those made in Publications offered on our website, are those of the respective author(s) or publisher(s) and not of DiscountMags. DiscountMags does not guarantee the accuracy, completeness, truthfulness, or usefulness of all or any portion of any publication or any services or offers made by third parties, nor will we be liable for any loss or damage caused by your reliance on information contained in any Publication, or your use of services offered, or your acceptance of any offers made through the Service or the Publications. For content removal requests, please contact Zinio.

© 1999 – 2025 DiscountMags.com All rights reserved.