Skip to content

Instantly share code, notes, and snippets.

View jspiewak's full-sized avatar

Joshua Spiewak jspiewak

  • Posit
  • Boston, MA
View GitHub Profile
@jspiewak
jspiewak / trace-all-events.js
Last active December 20, 2015 20:59 — forked from bnoordhuis/trace-all-events.js
Assign each object an id and log emitted events with the id.
(function() {
var id = 0;
function generateId() { return id++; };
Object.prototype.id = function() {
var newId = generateId();
this.id = function() { return newId; };