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

Event listeners cleaner #165

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixes to comments and events clear logic
swarty committed Nov 14, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit e6e8a8219e1c142382bbba46f16850a98e798959
4 changes: 2 additions & 2 deletions src/elements.ts
Original file line number Diff line number Diff line change
@@ -597,7 +597,7 @@ export abstract class BaseView<T extends HTMLElement|SVGElement> {
/** Removes this element. */
remove() {
const unsubscibe = (node: ElementView) => {
node.offAll.call(node);
node.offAll();

node._mutationObserver?.disconnect();

@@ -606,7 +606,7 @@ export abstract class BaseView<T extends HTMLElement|SVGElement> {
}

// hack to avoid TS notification
// about settings undefined to readonly properties
// about setting undefined value to readonly properties
delete (node as any)._el;
delete (node as any)._data;
delete (node as any)._events;