Skip to content

Support for WICG Observable #51828

Open
Open
@H4ad

Description

@H4ad

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.never-staleMark issue so that it is never considered staleweb-standardsIssues and PRs related to Web APIs

    Type

    No type

    Projects

    Status

    Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions