Created
June 10, 2019 08:19
-
-
Save lucasmrdt/db89bb4716591095838a4c713791f5df to your computer and use it in GitHub Desktop.
Remove all events of type of DOM element
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
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