-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
Shouldn't Aurelia.enhance resolve at some point? #480
Comments
It looks like a bug, this line: https://github.com/aurelia/framework/blob/master/src/aurelia.js#L110 should resolve |
Yes, that would make the promise resolve ... but it does not solve the issue as there is no guarantee that when the returned promise resolves, the That's what I was meaning when I was mentioning the 'gears it puts in motion behind the scenes'. Making the promise resolve is easy enough, making it resolve only after |
I took some time to look at the 'gears', and it seems that what would be needed to achieve the above mentioned behavior would involve a possibly important refactor of aurelia/templating to make every |
The component lifecycle methods are always synchronous. Changing that would ruin the framework probably ;) |
Ok. Just seen your reply in #367. I'll submit the PR to fix the return value for enhance then and will investigate what can be done about my particular use case. |
Not sure if it's a bug, if it's intentional or if there was no other option.
From what I understand from the source code, the Promise returned by
Aurelia.enhance
never resolves.As a consequence, there is no way to execute something only when the enhancement is completed.
I'm asking that because I'm trying to test a relatively complex component (using a slightly altered version of
aurelia-testing
but that works similarly, callingaurelia.enhance
the same way), and the component is not rendered when the actual test starts (I said it was a relatively complex one!). I can'tawait
the enhancement as it never resolves, so the only option for now is to use an appropriate timeout, which is not ideal.Would there be a way to make this promise resolve at some point, or would the fact that all the gears it puts in motion behind the scenes prevent this?
Thanks in advance
The text was updated successfully, but these errors were encountered: