enhance: new lazy blocks implementation

1. GC blocks below viewport only
2. No long uses heavy react-intersection-observer
This commit is contained in:
Tienson Qin
2023-09-04 22:00:45 +08:00
parent 43ca48bdde
commit f8f2f987c4
6 changed files with 190 additions and 172 deletions

View File

@@ -486,7 +486,7 @@
(rum/defc main <
{:did-mount (fn [state]
(when-let [element (gdom/getElement "app-container")]
(when-let [element (gdom/getElement "main-content-container")]
(dnd/subscribe!
element
:upload-files
@@ -499,7 +499,7 @@
(set! (.. element -scrollTop) 0)))
state)
:will-unmount (fn [state]
(when-let [el (gdom/getElement "app-container")]
(when-let [el (gdom/getElement "main-content-container")]
(dnd/unsubscribe! el :upload-files))
state)}
[{:keys [route-match margin-less-pages? route-name indexeddb-support? db-restoring? main-content show-action-bar? show-recording-bar?]}]