Skip to content

Commit 12b155b

Browse files
committed
[fix] enforce sideffects for event listeners registration
1 parent d342a9a commit 12b155b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

bower.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@
1010
},
1111
"devDependencies": {
1212
"angular-mocks": "latest"
13-
},
14-
"resolutions": {
15-
"crossfilter": "~1.3.0"
1613
}
1714
}

dist/angular-dc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(function(root, factory) {
22
if (typeof define === 'function' && define.amd) {
33
// AMD. Register as an anonymous module unless amdModuleId is set
4-
define(['angular', 'dc', 'lodash', 'd3'], function(angular, dc, lodash, d3) {
5-
return (root['angularDc'] = factory(angular, dc, lodash, d3));
4+
define(['angular', 'dc', 'lodash', 'd3'], function(a0, b1, c2, d3) {
5+
return (root['angularDc'] = factory(a0, b1, c2, d3));
66
});
77
} else if (typeof exports === 'object') {
88
// Node. Does not work with strict CommonJS, but
@@ -89,6 +89,8 @@
8989
eventHandlers.each(function(handler, evt) {
9090
chart.on(evt, handler);
9191
});
92+
// run the chain to enforce side effects (registration of handlers), ignore the result
93+
eventHandlers.value();
9294
// Run the postSetupChart callback, if provided
9395
if (_.isFunction(options.postSetupChart)) {
9496
options.postSetupChart(chart, options);

dist/angular-dc.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/angular-dc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ angularDc.directive('dcChart', ['$timeout',
8787
eventHandlers.each(function(handler, evt) {
8888
chart.on(evt, handler);
8989
});
90-
90+
// run the chain to enforce side effects (registration of handlers), ignore the result
91+
eventHandlers.value();
9192
// Run the postSetupChart callback, if provided
9293
if (_.isFunction(options.postSetupChart)) {
9394
options.postSetupChart(chart, options);

0 commit comments

Comments
 (0)