1.0.0 • Published 6 years ago

binary-lazy-loading v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

binary-lazy-loading

Instead of brute forcing the entire list of images to be lazily loaded, use binary search algorithm to minimize looping of testing whether the element is in view port or not.

Configure

Call registerLazyImageScrollHandler() in componentDidMount of root class to register scroll listener.

How to use it ?

Just import it using import LazyImage from 'lazy-image' & whereever <img /> tag is needed, use <LazyImage src={this.props.src} />. And that will lazy load the image with optimized version of lazy loading.