Design Patterns in JavaScript: Observer & Iterator Behavioral Patterns
In this 12-video course learners discover how to implement the Observer pattern for communication and the Iterator pattern to work with collections. Examine how to set up publishers and subscribers and the role of Observer pattern in event handling then learn how to trigger custom events in jQuery use Observer pattern with custom events iterate over elements in a collection and use Iterators in jQuery. Key concepts covered here include main characteristics of Observer pattern and how it is widely used in practice; how to implement publishers and subscribers; and how to publish messages with the publisher and receive them as subscribers. Learn about the role of Observer pattern in event handling; how to trigger custom events in jQuery; and observe how to design the Observer pattern with custom events in jQuery. Finally learn about characteristics of Iterator pattern and how it allows access to elements within a collection in a sequential manner; how to implement Iterator Mixin; learn iterating over elements in a collection; and implement Iterators in jQuery.