ionic-team/stencil-site

Improve `componentOnReady` suggestion note for non-lazy builds

jcfranco opened this issue · 2 comments

The doc for componentOnReady recommends Ionic's similarly-named util for consistent behavior between lazy and non-lazy-loaded builds:

If you want to simulate the behavior of componentOnReady() for non-lazy builds, you can implement a helper method to wrap the functionality similar to what the Ionic Framework does here.

A note should be added this being similar in functionality in the non-lazy-loaded builds only if none of the component lifecycle methods return a promise. Otherwise, the callback will resolve after a requestAnimationFrame, but possibly before async component lifecycle methods resolve.

@jcfranco thanks for raising an issue for this. Would you be interested making such a change in the docs as you have most context about it? Happy to support where help is needed.

I'd be glad to help, but I'm not clear on what to suggest as an alternative to the Ionic util for these cases.