This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-01
Channels
- # aleph (1)
- # bangalore-clj (5)
- # beginners (24)
- # boot (113)
- # cider (42)
- # cljs-dev (2)
- # cljsjs (2)
- # cljsrn (3)
- # clojure (37)
- # clojure-austin (4)
- # clojure-brasil (3)
- # clojure-france (55)
- # clojure-greece (15)
- # clojure-ireland (4)
- # clojure-italy (13)
- # clojure-russia (37)
- # clojure-spec (50)
- # clojure-uk (31)
- # clojurescript (49)
- # component (12)
- # consulting (1)
- # cursive (6)
- # datascript (9)
- # datomic (27)
- # editors (2)
- # garden (1)
- # hoplon (18)
- # jobs (1)
- # klipse (25)
- # lein-figwheel (1)
- # leiningen (1)
- # luminus (2)
- # om (53)
- # om-next (8)
- # onyx (5)
- # parinfer (4)
- # perun (4)
- # re-frame (13)
- # remote-jobs (1)
- # ring (1)
- # ring-swagger (3)
- # rum (52)
- # spacemacs (36)
- # specter (13)
- # sql (3)
- # untangled (49)
- # vim (11)
- # yada (9)
i noticed that adding specter to my clojurescript project increased the compiled file size from 550kb to 830kb after google closure advanced optimization. that's quite an increase, and i'm only referencing [select ALL]
. does that seem normal?
@joshkh I'm not familiar enough with cljs to understand those details
any idea what the increase is? the compiled js for specter?
i'll investigate. it's a bit hard to tell at first glance because advanced optimization munges everything into one garbled file.
ok, thanks
might be a good idea to open an issue on this to track it
Having some issues transforming map:
I expected the output to be {:parent {:grandchild {}}}
(require '[com.rpl.specter.macros :as spm])
(require '[com.rpl.specter :as sp])
(spm/transform [:parent sp/ALL] #(get-in % [:child]) {:parent {:child {:grandchild {}}}})
=> {:parent {nil nil}}
Running this will get me close to the desired output:
(spm/transform [:parent sp/ALL] #(get-in % [:child]) {:parent [{:child {:grandchild {}}}]})
=> {:parent [{:grandchild {}}]}
how can i achieve the desired result without changing the datastructure?
reading the docs for ALL ({:doc "Navigate to every element of the collection. For maps navigates to
a vector of [key value]
."}) tells me I'll have to deconstruct & reconstruct data structure manually.
@shooodooken is this what you want?
(transform :parent :child {:parent {:child {:grandchild {}}}})
yes sir, thank you. (the real code was bit more tricky but dropping the ALL was ultimately what I needed)