-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event to detect all components init is complete #954
Comments
Nothing like this is currently provided as far as I recall. What we could do is have |
What I have now is ES5 dist version of Your solution seems fine. I am only not sure how the promise it will get handled in ES5 version. Can you show example? |
Babel loader can back transpile them. |
@Garbee is right that we do not have something provides that for the moment but this is definitely a valid ask. We have been trying to avoid using promise in MDC for compatibility consideration, but we believe a custom event should be enough to help here. @yshterev Would you like file a PR for helping us making the changes? The files we need to change are:
Once you have the PR, we will help you merge it in. |
+1 for event over promise :) I will make the PR. |
Quick question reflected in the PR. @yshterev Is the event wanted after ALL component/after auto-init finished, or EACH component as soon as they instantiated? I can see both of them valid but which one would be more useful. |
All for auto init. Each component level events would be tricky to have a case for now. As the events could fire in many cases before or after being in the DOM. So there isn't much there other than a thing happened that could be consistently relied on. Component level events should be assessed as needed. |
@yshterev @Garbee I see. This make sense. In this case, instead of using |
Is there a way to know when
mdc
components are completely loaded aftermdc.autoInit()
is called? I cannot find anything like this in the docs.The text was updated successfully, but these errors were encountered: