0%

Book Description

With the advent of HTML5, front-end MVC, and Node.js, JavaScript is ubiquitous--and still messy. This book will give you a solid foundation for managing async tasks without losing your sanity in a tangle of callbacks. It's a fast-paced guide to the most essential techniques for dealing with async behavior, including PubSub, evented models, and Promises. With these tricks up your sleeve, you'll be better prepared to manage the complexity of large web apps and deliver responsive code.

Book Description

With the advent of HTML5, front-end MVC, and Node.js, JavaScript is ubiquitous--and still messy. This book will give you a solid foundation for managing async tasks without losing your sanity in a tangle of callbacks. It's a fast-paced guide to the most essential techniques for dealing with async behavior, including PubSub, evented models, and Promises. With these tricks up your sleeve, you'll be better prepared to manage the complexity of large web apps and deliver responsive code.

Table of Contents

  1. Async JavaScript
    1. Copyright
    2. For the Best Reading Experience...
    3. Table of Contents
    4. Early Praise for Async JavaScript
    5. Acknowledgments
    6. Introduction
      1. Trouble in Paradise
      2. Who Is This Book For?
      3. Resources for Learning JavaScript
      4. Where to Turn for Help?
      5. Running the Code Examples
      6. Code Style in This Book
      7. A Word on altJS
      8. Resources for This Book
    7. Chapter 1: Understanding JavaScript Events
      1. Scheduling Events
      2. Types of Async Functions
      3. Writing Async Functions
      4. Handling Async Errors
      5. Un-nesting Callbacks
      6. What We’ve Learned
    8. Chapter 2: Distributing Events
      1. PubSub
      2. Evented Models
      3. Custom jQuery Events
      4. What We’ve Learned
    9. Chapter 3: Promises and Deferreds
      1. A Very Brief History of Promises
      2. Making Promises
      3. Passing Data to Callbacks
      4. Progress Notifications
      5. Combining Promises
      6. Binding to the Future with pipe
      7. jQuery vs. Promises/A
      8. Replacing Callbacks with Promises
      9. What We’ve Learned
    10. Chapter 4: Flow Control with Async.js
      1. The Async Ordering Problem
      2. Async Collection Methods
      3. Organizing Tasks with Async.js
      4. Dynamic Async Queuing
      5. Minimalist Flow Control with Step
      6. What We’ve Learned
    11. Chapter 5: Multithreading with Workers
      1. Web Workers
      2. Node Workers with cluster
      3. What We’ve Learned
    12. Chapter 6: Async Script Loading
      1. Limitations and Caveats
      2. Reintroducing the < script > Tag
      3. Programmatic Loading
      4. What We’ve Learned
    13. Appendix 1: Tools for Taming JavaScript
      1. TameJS
      2. StratifiedJS
      3. Kaffeine
      4. Streamline.js
      5. Node-Fibers
      6. The Future of JavaScript: Generators
3.15.168.203