-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Open
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.never-staleMark issue so that it is never considered staleMark issue so that it is never considered staleweb-standardsIssues and PRs related to Web APIsIssues and PRs related to Web APIs
Description
What is the problem this feature will solve?
This new proposal adds .when
method to EventTarget
, then we can control event handling using Observable API.
Example from the spec:
// Filtering and mapping:
element
.when('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 .when
method at:
node/lib/internal/event_target.js
Line 551 in a0ac8bd
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
shrujalshah28, TKDev7, tonivj5, derdeka, TheOneTheOnlyJJ and 1 moretonivj5, o-t-w and TheOneTheOnlyJJ
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.never-staleMark issue so that it is never considered staleMark issue so that it is never considered staleweb-standardsIssues and PRs related to Web APIsIssues and PRs related to Web APIs
Type
Projects
Status
Triaged