ajacksified / ajacksified/Mediator.js

multiple once for the same subscriber

Abierto
#49 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
460
Forks
75
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

It seems that if I subscribe twice to the same channel with the same subscriber with the "once" method, then if I "publish", the channel will be executed twice for the subscriber !

I thought "once" would have meant :
- one subscription by subscriber, avoiding multiple subscriptions for the same subscriber.
- when published once, then unsubscribed (that part is ok).

Example :

mediator.once("test", function () { print("Hello world!"); });
mediator.once("test", function () { print("Hello world!"); });
mediator.publish("test");

...seem to print :

"Hello world!" "Hello world!"

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.