d3-dispatch
Advanced tools
Comparing version 0.1.0 to 0.2.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
global.dispatch = factory(); | ||
}(this, function () { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
factory((global.dispatch = {})); | ||
}(this, function (exports) { 'use strict'; | ||
@@ -99,6 +99,4 @@ function Dispatch(types) { | ||
var index = dispatch; | ||
exports.dispatch = dispatch; | ||
return index; | ||
})); |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.dispatch=n()}(this,function(){"use strict";function e(e){function n(e){var n=(e+="").indexOf("."),t=e;if(n>=0?e=e.slice(0,n):t+=".",e&&!u.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}function t(e){return function(){for(var n,t,r=u[e],i=-1,o=r.length;++i<o;)(t=(n=r[i]).value)&&t.apply(this,arguments);return l}}var r,i=-1,o=e.length,u={},a={},l=this;for(l.on=function(e,t){if(e=n(e),arguments.length<2)return(t=a[e.name])&&t.value;if(e.type){var r,i=u[e.type],o=a[e.name];o&&(o.value=null,r=i.indexOf(o),u[e.type]=i=i.slice(0,r).concat(i.slice(r+1)),delete a[e.name]),t&&(t={value:t},a[e.name]=t,i.push(t))}else if(null==t)for(var f in u)if(t=a[f+e.name]){t.value=null;var i=u[f],r=i.indexOf(t);u[f]=i.slice(0,r).concat(i.slice(r+1)),delete a[t.name]}return l};++i<o;){if(r=e[i]+"",!r||r in l)throw new Error("illegal or duplicate type: "+r);u[r]=[],l[r]=t(r)}}function n(){return new e(arguments)}n.prototype=e.prototype;var t=n;return t}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.dispatch={})}(this,function(e){"use strict";function n(e){function n(e){var n=(e+="").indexOf("."),t=e;if(n>=0?e=e.slice(0,n):t+=".",e&&!u.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}function t(e){return function(){for(var n,t,r=u[e],i=-1,o=r.length;++i<o;)(t=(n=r[i]).value)&&t.apply(this,arguments);return f}}var r,i=-1,o=e.length,u={},a={},f=this;for(f.on=function(e,t){if(e=n(e),arguments.length<2)return(t=a[e.name])&&t.value;if(e.type){var r,i=u[e.type],o=a[e.name];o&&(o.value=null,r=i.indexOf(o),u[e.type]=i=i.slice(0,r).concat(i.slice(r+1)),delete a[e.name]),t&&(t={value:t},a[e.name]=t,i.push(t))}else if(null==t)for(var l in u)if(t=a[l+e.name]){t.value=null;var i=u[l],r=i.indexOf(t);u[l]=i.slice(0,r).concat(i.slice(r+1)),delete a[t.name]}return f};++i<o;){if(r=e[i]+"",!r||r in f)throw new Error("illegal or duplicate type: "+r);u[r]=[],f[r]=t(r)}}function t(){return new n(arguments)}t.prototype=n.prototype,e.dispatch=t}); |
import dispatch from "./src/dispatch"; | ||
export default dispatch; | ||
export { | ||
dispatch | ||
}; |
{ | ||
"name": "d3-dispatch", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Register named callbacks and call them with arguments.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -39,3 +39,3 @@ # d3-dispatch | ||
<a name="on" href="#on">#</a> dispatch.<b>on</b>(<i>type</i>[, <i>callback</i>]) | ||
<a name="on" href="#on">#</a> *dispatch*.<b>on</b>(<i>type</i>[, <i>callback</i>]) | ||
@@ -48,3 +48,3 @@ Adds, removes or gets an *callback* of the specified *type*. | ||
<a name="type" href="#type">#</a> dispatch.<b>*type*</b>(<i>arguments…</i>) | ||
<a name="type" href="#type">#</a> *dispatch*.<b>*type*</b>(<i>arguments…</i>) | ||
@@ -51,0 +51,0 @@ The *type* method (such as `dispatch.start` for the `"start"` type) invokes each registered callback for the specified type, passing the callback the specified *arguments*. The `this` context will be used as the context of the registered callbacks. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13183
165
0