From 8d7e4dde0ec39440bb924b6ad0d0355af20527a6 Mon Sep 17 00:00:00 2001 From: arne Date: Thu, 20 Nov 2025 12:19:48 +0100 Subject: [PATCH] Debounce refresh when typing --- src/computersandblues/lodestone/app.cljs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/computersandblues/lodestone/app.cljs b/src/computersandblues/lodestone/app.cljs index af14545..70cd04d 100644 --- a/src/computersandblues/lodestone/app.cljs +++ b/src/computersandblues/lodestone/app.cljs @@ -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