Skip to content

Instantly share code, notes, and snippets.

View rriixx's full-sized avatar
💭

Patrick Bauer rriixx

💭
View GitHub Profile
@rriixx
rriixx / lazy-loading-feature.ts
Last active October 6, 2020 07:42
Native Lazy Loading
export default class LazyLoadingFeature {
supported = false
detect () {
if (typeof HTMLImageElement === 'undefined') return
this.supported = HTMLImageElement && 'loading' in HTMLImageElement.prototype
}
polyfill () {