Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite and refactor the entire script. #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Rewrite and refactor the entire script. #13

wants to merge 1 commit into from

Conversation

knadh
Copy link
Owner

@knadh knadh commented Apr 13, 2024

  • 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.
@knadh knadh mentioned this pull request Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unregister element
1 participant