ajacksified / ajacksified/Mediator.js

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

オープン
#42 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
460
フォーク
75
PR マージ指標
30日以内にマージされた PR はありません

説明

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?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。