-
Notifications
You must be signed in to change notification settings - Fork 510
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
Lazy loading with reconfig: true edge cases #54
Comments
Thanks for the very detailed issue, I will look into it but not until next week. In the mean time, could you try the code from this PR: #44 which you should be able to find here: https://github.com/BenBlazely/ocLazyLoad/blob/master/src/ocLazyLoad.js ? |
@ocombe thanks for the suggestion. This particular PR doesn't fix my issue. Would look forward to your feedback next week. Until then, take it easy. |
Chiming in here, as I'm running into the same issue. It appears to be the case that if reconfig is called at any point in an element passed into invokeQueue (prior to the resolution of all promises), the loop at 664 dies. Need to read over the rest of the source for a clearer picture, but if anything, I hope this helps |
@ocombe any more progress on this. This is non-critical for me, as it was just about writing a blog post on combining the power of ocLazyLoad with ui-router-extras. But nevertheless, a closure would be nice :) Interestingly, I haven't yet run into this in production - if that happens, I would have to resort to eager loading. |
I started working on this yes, should know more tomorow (I spent most of the day catching up on emails & news) |
Ok it's fixed ! There was a case where reconfig would not work as expected :) |
Terrific! 👍 it worked. Thanks. |
I have had fair success using ocLazyLoad with ui-router-extras futureStates to lazy load requirejs-bases angular modules that define ui-router states. Huh! that line included some 4 packages.
I have had to use the
reconfig: true
so far. Now, I am trying to create a demo app and for some reason, I can never get the config block of the second lazy loaded module to run.Run with the example and the first lazy loaded module (choose apple, or orange) works.
Example
Source code
ocLazyLoad code
Breakpointing in
js/states/apple.js
andjs/states/orange.js
, you will find that whichever one is clicked first gets its config block run properly, while the second lazy loaded module would not.Any further insights as to what might be happening?
The text was updated successfully, but these errors were encountered: