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

Support for WICG Observable #51828

Open
H4ad opened this issue Feb 21, 2024 · 0 comments · May be fixed by #53399
Open

Support for WICG Observable #51828

H4ad opened this issue Feb 21, 2024 · 0 comments · May be fixed by #53399
Labels
feature request Issues that request new features to be added to Node.js.

Comments

@H4ad
Copy link
Member

H4ad commented Feb 21, 2024

What is the problem this feature will solve?

This new proposal adds .on method to EventTarget, then we can control event handling using Observable API.

Example from the spec:

// Filtering and mapping:
element
	.on('click')
	.filter((e) => e.target.matches('.foo'))
	.map((e) => ({ x: e.clientX, y: e.clientY }))
	.subscribe({ next: handleClickAtPoint });

Spec: https://github.com/WICG/Observable
Standard Tracking: WICG/observable#93

This is something that makes sense to implement on Node?

What is the feature you are proposing to solve the problem?

Basically implements the new .on method at:

class EventTarget {

What alternatives have you considered?

The @benlesh (contributor of the spec) looks like he already tried to implement this new spec at #51065

@H4ad H4ad added the feature request Issues that request new features to be added to Node.js. label Feb 21, 2024
@H4ad H4ad linked a pull request Jun 10, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js.
Projects
Status: Pending Triage
Development

Successfully merging a pull request may close this issue.

1 participant