From 4458ba3ea33bb45d224c5211e9024f618b4fbd11 Mon Sep 17 00:00:00 2001 From: gered Date: Sat, 21 May 2016 17:21:03 -0400 Subject: [PATCH] replace add-hint! with queue-hints! --- src/views/core.clj | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/views/core.clj b/src/views/core.clj index d1b8372..dc8ba82 100644 --- a/src/views/core.clj +++ b/src/views/core.clj @@ -345,10 +345,14 @@ [namespace hint type] {:namespace namespace :hint hint :type type}) -(defn add-hint! - "Add a hint to the system." - [hint] - (swap! view-system update-in [:hints] (fnil conj #{}) hint)) +(defn queue-hints! + "Queues up hints in the view system so that they will be picked up by the refresh + watcher and dispatched to the workers resulting in view updates being sent out + for the relevant views/subscribers." + [hints] + (swap! view-system update-in [:hints] + (fn [existing-hints] + (reduce conj (or existing-hints #{}) hints)))) (defn put-hints! "Adds a collection of hints to the view system by using the view system