Debounce refresh when typing

This commit is contained in:
arne 2025-11-20 12:19:48 +01:00
commit 8d7e4dde0e

View file

@ -153,7 +153,7 @@
(obtain-oauth-authorization-code! application))))))
(declare fetch-posts!)
(declare refresh-displayed-posts!)
(declare debounced-refresh!)
(defn- fetch-application-settings []
(->> (db/open-cursor! ::db/application db/all)
@ -200,7 +200,7 @@
(if (zero? post-count)
(fetch-posts! {:instance-url (:instance_url application)
:bearer-token (:bearer_token application)})
(refresh-displayed-posts! (:section/posts @state))))))))
(debounced-refresh! (:section/posts @state))))))))
;;; views
@ -287,7 +287,7 @@
:on-change (fn [e]
(let [query (.. e -target -value)]
(swap! state assoc-in [:section/posts :query] (if (str/blank? query) nil query))
(refresh-displayed-posts! (:section/posts @state))))}])
(debounced-refresh! (:section/posts @state))))}])
(defn- debug
"Implements a lazy pretty-printer for whatever is passed in as `obj`. The