Reputation: 363
I have a task to get some data from API asynchronously - page loads, components initialize and fill data object with mediator, and after all components were initialized - send request, get it and do some other logic. So, the question is, how can I detect that all page components have been initialized?
Upvotes: 1
Views: 111
Reputation: 526
Mediator triggers page:afterChange
event once all standard components are initialized and ready to use. So you can listen to that event.
https://doc.oroinc.com/frontend/javascript/#page-controller
Upvotes: 2