minor nitpicky "cleanups"

This commit is contained in:
Gered 2016-05-24 10:38:01 -04:00
parent e86ab23603
commit 20be582a1a
2 changed files with 3 additions and 4 deletions

View file

@ -58,7 +58,7 @@
propagate the changes to the server." propagate the changes to the server."
[view-id & parameters] [view-id & parameters]
(let [view-sig {:view-id view-id (let [view-sig {:view-id view-id
:parameters (or parameters [])} :parameters (if parameters (vec parameters) [])}
this (r/current-component)] this (r/current-component)]
(assert (not (nil? this)) "view-cursor can only be used within a defvc component's render function.") (assert (not (nil? this)) "view-cursor can only be used within a defvc component's render function.")
(update-component-state! this #(update-in % [:used-view-sigs] conj view-sig)) (update-component-state! this #(update-in % [:used-view-sigs] conj view-sig))

View file

@ -31,9 +31,8 @@
(defn- handle-view-refresh [view-sig data] (defn- handle-view-refresh [view-sig data]
(let [cursor (r/cursor view-data [view-sig])] (let [cursor (r/cursor view-data [view-sig])]
(swap! cursor (swap! cursor
#(-> % #(assoc % :loading false
(dissoc :loading?) :data data))))
(assoc :data data)))))
(defn subscribed? (defn subscribed?
"Returns true if we are currently subscribed to the specified view." "Returns true if we are currently subscribed to the specified view."