Persist events that not yet have a handler
- Lenguaje dominante
- TypeScript
- Estrellas
- 11.9k
- Forks
- 488
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
There's a risk that a event is emitted before its' handler has been registered. You might say that such code is bad design, but I'd like to be lazy ;) Also, given that code splitting is being more and more adopted, I think this scenario is very real.
Would it be possible to persist events that don't have a handler (yet)? Whenever `.on(...)` is run, mitt would then check the persisted events in order to find unprocessed ones, and then handle those events immediately.
I think the footprint for this change can be quite small, but I can't speak for performance. Maybe we can opt-in to the behaviour.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Lee el punto de entrada actual del emisor de TypeScript y sus pruebas existentes para entender cómo se comportan emit y .on(...) cuando no hay ningún handler registrado. Define el comportamiento de persistencia opt-in, incluidas las expectativas de orden, replay y rendimiento; se considera completado cuando los eventos no gestionados se conservan y se entregan cuando se registra posteriormente un handler, sin cambiar el comportamiento predeterminado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- developer-experience
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100