-
Notifications
You must be signed in to change notification settings - Fork 142
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
lazyLoad directive async issue #420
Comments
Thanks for a detailed issue! There is some race condition bug, where we unsubscribe to insection change to late (after we register the new image path but before we get an insection change event for the new image path). A quick fix to this is to not do anything if we don't have an image path. I have created a beta release |
I really appreciate your fast response, fix and adding new examples. I've tried it in stackblitz demo and my own project. I can confirm that |
This is included in |
I've encountered on serious issue when using
lazyLoad
directive in templates when usingasync
pipe where given observable is made of promise. For example, this is component's template:And this is code from component's
ngOnInit
function:From the results I get in my tests scenarios, there is some race condition where
lazyLoad
directive doesn't pickup changes if they occur too early.Here is the demo: https://stackblitz.com/edit/angular-8-lazyload-image-intersection-observer-async-issue?embed=1&file=src/app/app.component.ts
In more complex application, cases 4 and 5 does not work at all, but here in demo they sometimes work. I cannot distinguish whether this is problem from
ng-lazyload-image
or RxJS itself.The text was updated successfully, but these errors were encountered: