Cargando…

jQuery design patterns : learn the best practices on writing efficient jQuery applications to maximize performance in large-scale deployments /

Learn the best practices on writing efficient jQuery applications to maximize performance in large-scale deployments About This Book Learn about the observer pattern and the deferred observer pattern, two of the most popular design patterns that handle custom events Advance your jQuery skills by lea...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Greasidis, Thodoris (Autor)
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham : Packt Publishing, [2016]
Colección:Community experience distilled.
Temas:
Acceso en línea:Texto completo
Texto completo
Tabla de Contenidos:
  • Cover ; Copyright; Credits; About the Author; About the Reviewer; www.PacktPub.com; Table of Contents; Preface; Chapter 1: A Refresher on jQuery and the Composite Pattern ; jQuery and DOM scripting; Manipulating the DOM using jQuery; Method Chaining and Fluent Interfaces; The Composite Pattern; How the Composite Pattern is used by jQuery; Comparing the benefits over the plain DOM API; Using the Composite Pattern to develop applications; A sample use case; The Composite Collection Implementation; An example execution; Alternative implementations; The Iterator Pattern
  • How the Iterator Pattern is used by jQueryHow it pairs with the Composite Pattern; Where can it be used; Summary; Chapter 2: The Observer Pattern ; Introducing the Observer Pattern; How it is used by jQuery; The jQuery on method; The document-ready observer; Demonstrate a sample use case; How it is compared with event attributes; Avoid memory leaks; Introducing the Delegated Event Observer Pattern; How it simplifies our code; Compare the memory usage benefits; Summary; Chapter 3: The Publish/Subscribe Pattern ; Introducing the Publish/Subscribe Pattern
  • How it differs from the Observer PatternHow it is adopted by jQuery; Custom events in jQuery; Implementing a Pub/Sub scheme using custom events; Demonstrating a sample use case; Using Pub/Sub on the dashboard example; Extending the implementation; Using any object as a broker; Using custom event namespacing; Summary; Chapter 4: Divide and Conquer with the Module Pattern ; Modules and Namespaces; Encapsulating internal parts of an implementation; Avoiding global variables with Namespaces; The benefits of these patterns; The wide acceptance; The Object Literal Pattern; The Module Pattern
  • The IIFE building blockThe simple IIFE Module Pattern; How it is used by jQuery; The Namespace Parameter Module variant; The IIFE-contained Module variant; The Revealing Module Pattern; Using ES5 Strict Mode; Introducing ES6 Modules; Using Modules in jQuery applications; The main dashboard module; The categories module; The informationBox module; The counter module; Overview of the implementation; Summary; Chapter 5: The Facade Pattern ; Introducing the Facade Pattern; The benefits of this pattern; How it is adopted by jQuery; The jQuery DOM Traversal API
  • The property access and manipulation APIUsing Facades in our applications; Summary; Chapter 6: The Builder and Factory Patterns ; Introducing the Factory Pattern; How it is adopted by jQuery; Using Factories in our applications; Introducing the Builder Pattern; How it is adopted by jQuery's API; How it is used by jQuery internally; How to use it in our applications; Summary; Chapter 7: Asynchronous Control Flow Patterns ; Programming with callbacks; Using simple callbacks in JavaScript; Setting callbacks as object properties; Using callbacks in jQuery applications