O'Reilly logo

Pro Windows 8 Development with HTML5 and JavaScript by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 9

images

Using Promises

The basic premise of asynchronous programming in a Windows app is simple. You call a method and the work it performs is scheduled for later execution. At some point in the future, the work is performed and you are notified of the result by means of a callback function.

Asynchronous programming is well-established in JavaScript. You have probably already encountered asynchronous programming when you made an Ajax request in a web app. You wanted to load some content from the server, but didn’t want to prevent the user interacting with the app while this was happening. So, you made a method call using the XMLHttpRequest ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required