Fork me on GitHub
#specter
<
2017-07-14
>
frankmoyer22:07:10

I’m using specter in Clojurescript. I have a form that uses specter to remove a row from a deeply nested map. When I call the form from the repl, it works fine. When I run it from the browser, core.cljs?rel=1495975558928:89 Error: No protocol method IAssociative.-assoc defined for type cljs.core/LazySeq:..... I’d really like to get Specter working in Clojurescript, as it will make my code much more manageable. Here is the form:

(defn delete-row
  [db row-nbr]
  (->> db
       (sp/transform [:db (:active (:db db)) :blocks
                      (sp/if-path #(< 1 (count %)) (sp/keypath row-nbr))]
                     sp/NONE)
       (sp/setval    [:db (:active (:db db)) :blocks nil?]
                     sp/NONE)))

nathanmarz22:07:22

@frankmoyer which line is failing, the transform or the setval?

nathanmarz22:07:44

also, what is (:active (:db db))?

nathanmarz22:07:58

that returns a navigator?