ralix icon indicating copy to clipboard operation
ralix copied to clipboard

Add a new helper method to be able to remove events listeners

Open jfelip937 opened this issue 3 years ago • 0 comments

To be able to remove all listeners of a type/types given an element/array/query selector.

As we already have the on method it will be consistent to have a method to remove the listeners.

PROPOSED SOLUTION

To remove a specific eventListener:

unbind(elements, events, function)

To remove all eventListeners:

unbind(elements, events)

Arguments:

  • elements: Element / Array of Elements / Query selector
  • events: String with the type of events to remove
  • function: eventListener to be removed. If not added all eventListeners of the given types will be removed.

jfelip937 avatar Apr 27 '22 13:04 jfelip937