On 2014-07-18 2:28 PM, Dave Hylands wrote:

> No reason, other than I'm not familiar with EventListener. What is an 
> EventListener and how would you use it? Maybe just point me at an example? 


  deviceStorage.addEventListener('newarea', function(event) {
    // Handle new area being available.
  });

It's a generic pattern implemented by many objects, and multiple
listeners can be registered. You define the event names and the rules
for triggering them in the spec, then code can easily subscribe to the
changes it wants to observe.

http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Registration-interfaces
https://developer.mozilla.org/en-US/docs/Web/API/EventListener

 -r
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to