ajacksified / ajacksified/Mediator.js
Is there a way to wait until all listeners have completed (async) tasks?
- Ngôn ngữ chính
- JavaScript
- Star
- 460
- Fork
- 75
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.