Open
Description
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:
node/lib/internal/event_target.js
Line 551 in a0ac8bd
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
Labels
Type
Projects
Status
Triaged