stuyam / pressure

:point_down::boom: JavaScript library for handling Force Touch, 3D Touch, and Pointer Pressure.
https://pressurejs.com
MIT License
2.92k stars 97 forks source link

How do you remove a Pressure listener from an element? #77

Open garrettmaring opened 5 years ago

stuyam commented 5 years ago

Currently we don't support a way of doing this out of the box. For this to work we would need to add something like an unbindEvents() which would use the removeEventListener method which would allow you to call in some way to unbind the binded events.

Open to pull requests on this, will take a look when I get a chance. Not sure if there is a way you can do it right now without the implementation.

darkyen commented 5 years ago

Currently we don't support a way of doing this out of the box. For this to work we would need to add something like an unbindEvents() which would use the removeEventListener method which would allow you to call in some way to unbind the binded events.

Open to pull requests on this, will take a look when I get a chance. Not sure if there is a way you can do it right now without the implementation.

Is all the state etc sync'd on the dom node?

stuyam commented 5 years ago

The only thing on the dom node will be the added event listeners. What did you have in mind @darkyen?

Pranav2612000 commented 3 years ago

Any hacks for doing this?