lbry-desktop/ui
infinite-persistence f7cf21b661 useLazyLoading: start loading when near viewport
## Issue
#6332 <Thumbnail lazy-loader is too slow || Use browser-level lazy-loading>

## Change
Switch from "threshold-based check" to "viewport distance comparison" using the `rootMargin` parameter. The root is the viewport.

This change makes it closer to the native `loading="lazy"` behavior, where it starts to load when approaching the viewport. Chrome I believe uses 3000px distance -- I think 500px is a good compromise for now. Can adjust further.

## Future
- We are currently creating N instances of IntersectionObserver.
  - https://developers.google.com/web/updates/2016/04/intersectionobserver
  - "If you need to observe multiple elements, it is both possible and advised to observe multiple elements using the same IntersectionObserver instance by calling observe() multiple times."

This would probably need a refactor to make ClaimList (or something higher) own the IntersectionObserver.
2021-07-12 17:06:30 -04:00
..
component WaitUntilOnPage: take scaling into account 2021-07-12 17:06:30 -04:00
constants Skin fiat-tip notification 2021-07-08 11:21:58 +08:00
effects useLazyLoading: start loading when near viewport 2021-07-12 17:06:30 -04:00
modal Reload page when trying to open stale chunks 2021-07-08 15:06:09 +08:00
page Rename default import/exports for clarity in text search (no functional change) 2021-07-09 08:40:26 +08:00
redux Fix notification bell toast 2021-07-12 11:03:11 -04:00
scss Fix recommended tab style issues 2021-07-08 16:08:13 -04:00
util RSS: Use canonical_url (with ':') instead of slicing to 2 characters. 2021-07-12 17:06:03 -04:00
analytics.js Fix lint (removal of videoFetchDuration) 2021-06-10 10:14:52 -04:00
app.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
comments.js Commentron Moderation Delegation API 2021-06-18 15:46:51 -04:00
i18n.js Revert "Simplify language lists" 2021-04-06 15:42:27 -04:00
index.jsx CodeSplit: Load 3rd-party css before ours. 2021-06-25 16:00:45 +08:00
logWarningConsoleMessage.js new lbc icon 2020-09-29 17:12:32 -04:00
native.js working 2020-12-16 10:52:22 -05:00
reducers.js wip 2021-06-08 13:25:52 -04:00
rewards.js When a new reward is acquired, only close modals if the reward comes from reward_code 2021-01-08 08:16:41 -07:00
store.js improve pending over refreshes 2021-07-05 10:22:13 -04:00