Last active
May 27, 2016 15:31
-
-
Save Hypercubed/c4276ed96ff4bd575933c7ad390a7a92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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