How to remove event listeners after you've clicked another event listener

Hi guys,

I have event listeners for when I want to hover over something, the cursor will turn into a pointer, and similarly, when mouseout it returns to default. And that’s great and works perfectly.

but then I have another event listener which is a click function. and when it clicks I want it to then remove the other event listeners mentioned earlier… but removing event listeners don’t seem to work the same as adding, can someone help me with what’s wrong?

I’ve tried many different variations of remove but it doesn’t seem to do what I want them to do

threejs doesn’t have events, this is something in your code and without seeing it i seems unlikely it can be helped. can you make a codesandbox for that?

generally, by the point you’re dealing with complex event implementations like that, bubbling, stateful events, switching it on/off, imo the point is reached where oop turns into a dead end. you need a higher layer to express that cleanly or else you’ll be fighting against your own app by having to traverse it, race conditions etc. pensive-sound-q7od08 - CodeSandbox

oh yeah sorry I should’ve mentioned I installed domEvents for threejs, I suspect that addon has addEventListeners but doesn’t have remove.

but it’s okay I actually just ADDED another domevent which essentially countered my other one nestled within my click event listener.

so if anyones reading you can just do it like that