Builds client SSR approach, sunsets old cljs.
This commit is contained in:
@@ -143,3 +143,10 @@
|
||||
(defn update! [cursor v]
|
||||
"Replaces value supplied by cursor with value v."
|
||||
(-transact! cursor (constantly v)))
|
||||
|
||||
(defn ensure-path! [cursor p default]
|
||||
(let [next-to-last (get-in cursor (butlast p))
|
||||
next-to-last-v @next-to-last]
|
||||
(when (not (get next-to-last-v (last p)))
|
||||
(transact! next-to-last #(assoc % (last p) default))))
|
||||
cursor)
|
||||
|
||||
Reference in New Issue
Block a user