Skip to content

Instantly share code, notes, and snippets.

@Hypercubed
Last active May 27, 2016 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hypercubed/c4276ed96ff4bd575933c7ad390a7a92 to your computer and use it in GitHub Desktop.
Save Hypercubed/c4276ed96ff4bd575933c7ad390a7a92 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script src="https://d3js.org/d3-dispatch.v0.4.min.js"></script>
<script>
var dispatch = d3_dispatch.dispatch('foo');
dispatch.on('foo', handle);
var N = 3000;
var called = 0;
for (var i = 0; i < N; i++) {
dispatch.call('foo', this, 'bar');
}
function handle(a) {
if (typeof a === 'undefined') {
document.write('<br />undefined value at ' + called);
}
called++;
}
document.write('<p />called ' + N + ' times total');
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment