Add support iterator
- Lenguaje dominante
- JavaScript
- Estrellas
- 9k
- Forks
- 181
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
example
```js
const { on } = require('events');
const { request } = require('https');
const html = require('htm');
function h(type, props, ...children) {
return { type, props, children };
}
request('https://nodejs.org/en', async (res) => {
const iterator = on(res, "data");
const domIterator = html.bind(h).iterator(iterator);
for await (const element of emitter) {
console.log(element);
}
}).end();
request('https://nodejs.org/en', async (res) => {
const iterator = on(res, "data");
const domEmitter = html.bind(h).emitter(iterator);
domEmitter.on('div', (element) => {
console.log('emitter', element);
});
domEmitter.on('end', () => {
console.log('end');
});
}).end();
```
Guía de contribución
Línea de trabajo
Start with the issue's Node.js example and compare the requested html.bind(h).iterator(iterator) API with the shown .emitter(iterator) usage. Trace the existing htm binding entry point and determine the expected behavior for the async iterator and its completion; the work is done when the documented example runs with the intended element output.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- frontend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 35/100