minor nitpicky "cleanups"
This commit is contained in:
parent
e86ab23603
commit
20be582a1a
|
@ -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))
|
||||||
|
|
|
@ -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."
|
||||||
|
|
Loading…
Reference in a new issue