title: Remove Scroll event listener used in conjection with throttling function
body: <p>I have function which I call <strong>which opens a particular view</strong> on my page.</p>
  
  <pre><code>function dayViewOpen(target){
           var date = getDate();
            ..
            ..
            ..
          document.addEventListener('scroll',throttle(function(event){
              scrollAddData(date);
          },10));
  }
  </code></pre>
  
  <p>similarly I have a function to close that particular view</p>
  
  <pre><code> function dayViewClose(target){
          ..
          ..
  
  
      }
  </code></pre>
  
  <p><strong>everything till now its working perfectly.</strong> But problems start arising when I have to remove the earlier added event listener. I.e I have to remove the event listener when i call the function dayViewclose();</p>
  
  <p>I get it that we need to have a <strong>reference to listener</strong> to remove it, so I when i do it like this.</p>
  
  <pre><code>var handler = throttle(function(event){
                  scrollAddData();
              },10);
  
   function dayViewOpen(target){
           var date = getDate();
            ..
            ..
            ..
          document.addEventListener('scroll',handler,false);
  }
  
   function dayViewClose(target){
          ..
          ..
  
          //remove earlier added event listener
         document.removeEventListener('scroll',handler,false);
      }
  </code></pre>
  
  <ul>
  <li>then I am not able to pass the <strong>date</strong> parameter to the to my handler ( <strong>how can i pass the date parameter to the handler</strong> ) and</li>
  <li>Even if i let go of the date param then also i am not able to remove the handler with removeEvent Listener. ( <strong>how can i remove the event listener properly</strong> )</li>
  </ul>
  
  <p>Any help would be greatly apreciated</p>