🐛 Use scheduler on chunked-list component.

This commit is contained in:
Andrey Antukh 2019-08-06 09:08:00 +02:00
parent c9e88cfdb7
commit d2fe689fc5

View file

@ -34,7 +34,7 @@
state (mf/use-state initial)] state (mf/use-state initial)]
(mf/use-effect {:deps true (mf/use-effect {:deps true
:init #(when (pos? (:pending-num @state)) :init #(when (pos? (:pending-num @state))
(swap! state update-state)) (schedule-on-idle (fn [] (swap! state update-state))))
:end #(when % (rx/cancel! %))}) :end #(when % (rx/cancel! %))})
(for [item (:current @state)] (for [item (:current @state)]
(children item))))) (children item)))))