diff --git a/project.clj b/project.clj index 0077e1c..9288e30 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject views "1.1.0" +(defproject views "1.2.0" :description "A view to the past helps navigate the future." :url "https://github.com/diligenceengine/views" diff --git a/src/views/core.clj b/src/views/core.clj index 7832c6f..b3e662f 100644 --- a/src/views/core.clj +++ b/src/views/core.clj @@ -85,12 +85,13 @@ (or (:hints (first p)) #{}))) (defn refresh-views! - "Given a collection of hints, find all dirty views." - [view-system] - (let [hints (pop-hints! view-system)] - (debug "refresh hints:" hints) - (mapv #(refresh-view! view-system hints %) (subscribed-views @view-system)) - (swap! view-system assoc :last-update (System/currentTimeMillis)))) + "Given a collection of hints, or a single hint, find all dirty views and schedule them for a refresh." + ([view-system hints] + (debug "refresh hints:" hints) + (mapv #(refresh-view! view-system hints %) (subscribed-views @view-system)) + (swap! view-system assoc :last-update (System/currentTimeMillis))) + ([view-system] + (refresh-views! view-system (pop-hints! view-system)))) (defn can-refresh? [last-update min-refresh-interval]