Skip to content

Instantly share code, notes, and snippets.

@robmazan
Created February 19, 2020 16:22
Show Gist options
  • Save robmazan/4cfea1ba7e8eef7438cf1545df52ccbc to your computer and use it in GitHub Desktop.
Save robmazan/4cfea1ba7e8eef7438cf1545df52ccbc to your computer and use it in GitHub Desktop.
Count listeners under a subtree in Chrome DevTools
const countListeners = node => Array.from(node.children).reduce((acc, curr) => acc + countListeners(curr), Object.values(getEventListeners($0)).map(i => i.length).reduce((acc, curr) => acc + curr, 0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment