nodejs / nodejs/node

Support for WICG Observable

Ouverte
#51,828 2 commentaires 9 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

  • #53399 par @jasnell — fermée sans fusion
feature request never-stale web-standards
Langage dominant
JavaScript
Étoiles
122k
Forks
37.3k
Merge moyen
4 j 2 h
PR mergées (30 j)
283

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: https://github.com/WICG/observable/issues/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:

https://github.com/nodejs/node/blob/a0ac8bd4d85e5614f43e4fed3e0c73641cd45fa8/lib/internal/event_target.js#L551

What alternatives have you considered?

The @benlesh (contributor of the spec) looks like he already tried to implement this new spec at https://github.com/nodejs/node/pull/51065

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Start with lib/internal/event_target.js at the linked location and read the WICG Observable specification. Review the prior implementation attempt in pull request #51065 and the standard-tracking issue to understand the expected scope. Done means Node supports the proposed EventTarget .when API consistently with the specification and the example behavior.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript
Domaine
backend
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.