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

[DevTask] Use listener/subscriber pattern for node events #581

Open
christian-byrne opened this issue Feb 24, 2025 · 0 comments
Open

[DevTask] Use listener/subscriber pattern for node events #581

christian-byrne opened this issue Feb 24, 2025 · 0 comments

Comments

@christian-byrne
Copy link
Contributor

The current API for node events involves setting a callback as a property of the node. This forces consumers to compete for access to the property namespace, risking inadvertent overwrites or insufficient patching, which can disrupt existing closures. To address this, the node (and widget) events API should be enhanced to use a more reliable pattern such as events/listeners.

In particular, this improvement would improve the ability to register listeners to node lifecycle events, which is becoming increasingly important as the number of scenarios has increased in which objects tied to a node's lifecycle aren't automatically garbage-collected upon node removal—for example, Vue components, floating DOM elements, or Pinia store items keyed to the node.

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

No branches or pull requests

1 participant