Skip to content

Instantly share code, notes, and snippets.

@lucasmrdt
Created June 10, 2019 08:19
Show Gist options
  • Save lucasmrdt/db89bb4716591095838a4c713791f5df to your computer and use it in GitHub Desktop.
Save lucasmrdt/db89bb4716591095838a4c713791f5df to your computer and use it in GitHub Desktop.
Remove all events of type of DOM element
const removeAllEventsOf = (element, eventType) => (
(getEventListeners(element)[eventType] || []).forEach(e => (
element.removeEventListener(eventType, e.listener)
))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment