Select to view content in your preferred language

Do I have to cleanup DrawAction event listeners after completion?

138
1
12-13-2024 02:15 PM
GHvW33
by
New Contributor

When I create one of the various DrawActions via Draw. If the action completes, do I still need to clean up the event listeners I set up via the `.on()` method, or will those get cleaned up automatically upon completion?

0 Kudos
1 Reply
ReneRubalcava
Honored Contributor

Yeah, any listeners you create with "on" you need to clean up. The "on" method returns an object with a "remove()" method you can use for that.

https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-DrawAction.html#on

 

0 Kudos