Mastering JavaScript promises : discover and explore the world of promises, one of JavaScript's most powerful concepts /
This book is for all the software and web engineers wanting to apply the promises paradigm to their next project and get the best outcome from it. This book also acts as a reference for the engineers who are already using promises in their projects and want to improve their current knowledge to reac...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham, UK :
Packt Publishing,
2015.
|
Colección: | Community experience distilled.
|
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- Cover
- Copyright
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Table of Contents
- Preface
- Chapter 1: Promises.js
- The fall and rise of JavaScript
- Google's contributions to JavaScript
- Where Promises.js came in?
- What is a promise?
- Why do we need promise in JS?
- Software prerequisites
- Environment you need before getting started
- Future, promise, and delay
- Promise pipelining
- Read-only views
- States of a promise
- How do we keep Promises.js in this book?
- Browser compatibility
- SummaryChapter 2: The JavaScript Asynchronous Model
- Programming models
- The single-threaded synchronous model
- The multithreaded synchronous model
- The asynchronous programming model
- Densities with an asynchronous programming model
- Why do we need to block the task?
- Why not use some more threads?
- Learning the JavaScript asynchronous model
- How JavaScript implements an asynchronous model
- Callbacks in JavaScript
- Blocking functions
- The mechanism of a callback function in JavaScript
- Basic rules to implement callbacks
- ""Handling callback hell""""The events""; ""The mechanism of event handling""; ""DOM � event capture and event bubbling""; ""A list of the most common events handlers""; ""Triggering functions in response to events""; ""Types of events in JavaScript""; ""Interface events""; ""Mouse events""; ""Form events""; ""W3C events""; ""Microsoft events""; ""Mozilla events""; ""The publisher/subscriber""; ""A brief account of the observer pattern""; ""A formal definition of observer""; ""The push and pull model""; ""The promises object""; ""Summing up � the asynchronous programing model""
- SummaryChapter 3: The Promise Paradigm
- Callback, revisited
- Promise
- Deferred
- How do promise and deferred relate to each other?
- Standard behaviors of the Promise API
- Interactive promises
- The states and return values of a promise
- Common sequencing patterns
- Stacked
- Parallel
- Sequential
- Decoupling events and applications logic
- Promises as event emitters
- What promises prescribed not to do
- Avoiding getting into callback hell
- Avoiding the use of unnamed promises
- Promises and exceptions
- The fail method
- The then methodBest practices to handle exceptions in promise
- Make your exceptions meaningful
- Monitor, anticipate, and handle exception
- Keep it clean
- Considerations while choosing a promise
- Summary
- Chapter 4: Implementing Promises
- How to implement promises
- Implementations in Java
- The util package of Java
- The mechanics of Java to implement a promise
- The core components of java.util.concurrent
- Timing
- Synchronizers
- Concurrent collections
- The implementation of promise by Java
- CompletionService