title: Detect start and end of an event callback?
body: <p>I'm working with the new <a href="http://mapbox.com/blog/mapbox-javascript-api/" rel="nofollow">mapbox.js API</a>, especially the event callback 'panned'. The callback is fired about 50-100 times when the user moves the map, which is way too much. What's the best way to get only the first and the last event (or only the last) out of this?</p>
  
  <pre><code>map.addCallback('panned', function(move) {
    console.log('panned');
  });
  </code></pre>