Skip to main content

The Observer Pattern

  • Chapter
Pro JavaScript Design Patterns
  • 1828 Accesses

Abstract

In an event-driven environment, such as the browser where it is constantly seeking attention from a user, the observer pattern, also known as the publisher-subscriber pattern, is an excellent tool to manage the relationship between people and their jobs, or rather, objects, their actions, and their state. In JavaScript terms, this pattern essentially allows you to observe the state of an object in a program and be notified when it changes.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 59.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Ross Harmes and Dustin Diaz

About this chapter

Cite this chapter

(2008). The Observer Pattern. In: Pro JavaScript Design Patterns. Apress. https://doi.org/10.1007/978-1-4302-0496-1_15

Download citation

Publish with us

Policies and ethics