0

Is there a way to catch each event triggered by block of code and stop its propagation?

Something like

stopAllEvent(function(){
// some code that could trigger some events
//...
});

and each event triggered inside the function must be "stopped"...

Exists a way to do this?

davidinho
  • 169
  • 1
  • 14
  • 2
    Sounds either like an XY problem, or a problem that needs additional context for a reasonable answer. (why would a function to `stopAllEvent` *trigger* additional events, doesn't that defeat the purpose?) – CertainPerformance May 04 '18 at 09:00
  • Possible duplicate of [How to remove all listeners in an element?](https://stackoverflow.com/questions/9251837/how-to-remove-all-listeners-in-an-element) – Luca Kiebel May 04 '18 at 09:00
  • @CertainPerformance I've ah helper `clearValue` function that receive an HTML input(also more complex object of some javascript library) and clear it, but in some case I need that the function don't throw the event `change` – davidinho May 04 '18 at 09:06
  • Can't you just add that logic to the clearValue function? – Shilly May 04 '18 at 09:16

0 Answers0