Summary

The goal of this chapter was to introduce you to the features of the base WinJS library. In the first section, you learned how to organize your JavaScript code into modules, namespaces, and classes. By taking advantage of modules and namespaces, you can avoid polluting the global namespace and make your app easier to maintain over time.

Next, I discussed how you can take advantage of promises whenever you need to write asynchronous code. I discussed, for example, how you can use promises when performing Ajax requests. You learned how to create promises, cancel promises, chain promises, and compose new promises from existing promises.

I also discussed how you can use WinJS query selectors to retrieve DOM elements. You learned how to use ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.