title: Filtering events on window vs individual events on DOM nodes
body: <p>Consider the following code sample: </p>
  
  <pre><code>import R from 'ramda';
  import {Observable} from 'Rx';
  
  var allClicks_ = Observable.fromEvent(window, 'click').share();
  
  var getClicks = function(klass) {
    return allClicks_.filter(e =&gt; {
      return R.contains(klass, e.target.classList);
    });
  };
  
  getClicks('red').subscribe(x =&gt; {
    render('RED: ' + x.target.className);
  });
  
  getClicks('blue').subscribe(x =&gt; {
    render('BLUE: ' + x.target.className);
  });
  </code></pre>
  
  <p>Instead of adding click event listeners to ".red" and ".blue", I added an event listener to <code>window</code> and filtered events that are on ".red" and ".blue". </p>
  
  <p>Now what can go wrong with code like this? Is it more (or less) efficient than adding event listeners to individual DOM nodes? Or it has no performance benefits?</p>
  
  <p>Edit: Share the hot Observable so only one event handler is attached. </p>