Thread viewer for Bluesky
1function buildAvatarPreloader(): IntersectionObserver {
2 return new IntersectionObserver((entries, observer) => {
3 for (const entry of entries) {
4 if (entry.isIntersecting) {
5 const img = entry.target;
6 img.removeAttribute('lazy');
7 observer.unobserve(img);
8 }
9 }
10 }, {
11 rootMargin: '1000px 0px'
12 });
13}
14
15export let avatarPreloader = buildAvatarPreloader();