perf: add lazy support for block list

experiment/tanstack-table
Tienson Qin 2024-05-14 08:16:02 +08:00
parent 45bb11d28d
commit 0bdb02fdf4
1 changed files with 14 additions and 20 deletions

View File

@ -3439,26 +3439,20 @@
(let [top? (zero? idx)
bottom? (= (count blocks) (inc idx))]
(rum/with-key
(block-item (assoc config :top? top?)
item
{:top? top?
:idx idx
:bottom? bottom?})
(str "blocks-" (:block/uuid item)))
;; (ui/lazy-visible
;; (fn []
;; (rum/with-key
;; (block-item (assoc config :top? top?)
;; item
;; {:top? top?
;; :idx idx
;; :bottom? bottom?})
;; (str "blocks-" (:block/uuid item))))
;; {:trigger-once? false
;; :fade-in? false
;; :initial-state false
;; :debug-id (str (:db/id item) "-" (:block/content item))})
)))
(ui/lazy-visible
(fn []
(rum/with-key
(block-item (assoc config :top? top?)
item
{:top? top?
:idx idx
:bottom? bottom?})
(str "blocks-" (:block/uuid item))))
{:trigger-once? true
:fade-in? false
:initial-state false
:debug-id (str (:db/id item) "-" (:block/content item))})
(str (:container-id config) "-" (:db/id item))))))
(rum/defcs blocks-container < rum/static
{:init (fn [state]