Added opton for immediate view refresh.
This commit is contained in:
parent
bbf1a4c794
commit
626d0a6bb9
|
@ -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"
|
||||
|
|
|
@ -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)]
|
||||
"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))))
|
||||
(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]
|
||||
|
|
Loading…
Reference in a new issue