ajacksified / ajacksified/Mediator.js

Is there a way to wait until all listeners have completed (async) tasks?

Aperta
#42 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
460
Fork
75
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi,

I am using MediatorJS with requireJS modules. After a page change all my listeners will be informed and they will execute some tasks. Some tasks are async. This has the effect that this will not work constantly:

``` javascript
showLoader();

// Publish page change
mediator_.publish(
config_.mediator.channel.afterContentNavigation,
{
"content": $frameDoc,
"page": page
}
);

hideLoader();
```

As you can imagine if a components listens to the afterContentNavigation it will be triggered sure, but the hideLoader() function will may be called before the async task is completed.

Is there a way to handle such things with Mediator-JS?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.