Fork me on GitHub
#beginners
<
2017-04-04
>
thosmos06:04:45

@miguelb the foreign modules is very alpha. did you try adding a :module-type :commonjs or :module-type :amd to your :foreign-libs map?

deg12:04:02

What is a simple lein template for a CLJS library project? Details: I have widgets and utility code that I've built on top of re-com for various projects. I'd like to centralize them for reuse. So, I want to move them into their own project. - This project will never run standalone, so I don't need any server component - I want a simple project.clj script that doesn't try to do too much (at least not yet!). I looked at re-com's project.clj but, at 172 lines, it is doing far more than I want to bite off right now. - This code is still evolving, so I'd like to be able to edit it live. Typically, I'll be working on it from within the context of a project using it. So, I don't think this library needs to run figwheel, right? It's code just needs to be visible to the figwheel magic in the client project. - I do want to be able to run standalone tests on this library code, without involving any client project.

tap15:04:47

When should I use tools.reader.edn and when should I use clojure.edn? https://github.com/clojure/tools.reader https://clojure.github.io/clojure/clojure.edn-api.html

Alex Miller (Clojure team)16:04:22

Use clojure.edn if you're in Clojure and tools.reader.edn if you're in ClojureScript

tap16:04:49

Thanks, Alex

mss19:04:22

curious why the following function:

(partition-by #(mod % 2)
                      (range 10))
is returning ( (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) ) as opposed to ( (0 2 4 6 8) (1 3 5 7 9) ) am I misunderstanding how partition-by works?

noisesmith19:04:42

partition-by never re-orders the input

noisesmith19:04:57

mss maybe you want group-by

mss19:04:26

oh I see, so since my fn is returning a new value on each invocation of f, it keeps getting split on each invocation

noisesmith19:04:38

right, exactly

mss19:04:59

amazing, makes sense. thanks so much for the help