dragmove.js
dragmove.js copied to clipboard
Rewrite and refactor the entire script.
- Fully refactor the event handling approach and rewite the script to just have 3 global listeners instead of the earlier approach of having 2 events per item.
- Maintain items in a
WeakMap()instead of a maintaing states in a function per object. - Simplify logic for readability.
- Add
remove()to allow the drag/move events on an object to be unregistered.
The new approach should is significantly more memory efficient.
Closes #2.
Fully refactor the event handling approach and rewite the script to just have 3 global listeners instead of the earlier approach of having 2 events per item.
Maintain items in a
WeakMap()instead of a maintaing states in a function per object.Simplify logic for readability.
Add
remove()to allow the drag/move events on an object to be unregistered.The new approach should is significantly more memory efficient.
Closes #2.
aa6399d254a7d2fccb74bc19b3f55927d4b462da__