HaithemMosbahi / ngx-avatar

Universal avatar component for angular 2+ applications makes it possible to fetch / generate avatar from different sources
MIT License
236 stars 91 forks source link

Natively lazy load images when scrolling #102

Closed PowerKiKi closed 4 years ago

PowerKiKi commented 4 years ago

This enable native lazy loading of images when user scroll them into view, as described in https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading

It is especially useful when we have a long list of users and their avatar. Without this it would start anything between 10-100 http connections to fetch images that are not visible on screen. With this patch we improve performance of our app with very little effort and no downsides.

HaithemMosbahi commented 4 years ago

LGTM, Simple and efficient! Thanks @PowerKiKi I will merge it and release it