Rebinding exports in d3.js v4
<p>I'm creating a map using the modules system. I'm more or less used to D3.js v3 but I am still getting used to v4.</p>

<p>I am trying to add a dispatch but I don't know how to rebind the exports in V4, as this function is not available now.</p>

<p>So for my dispatch (_dis) and my particular event ("changetype"), the rebind in d3 v3 would be right before returning the exports, for example:</p>

<pre><code>d3.mapDots = function (districts){

   var _dis = d3.dispatch('changetype');

   (...)

   exports.color = function(_c){
       if(!arguments.length) return color;
       color = _c;
       return this;
   };    

   d3.rebind(exports,_dis,"on");
   return exports
   };
</code></pre>

<p>Does anyone know how to do this in v4? I've been trying dispatch.apply but it doesn't work.</p>

<p>Thanks!</p>