This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-16
Channels
- # admin-announcements (27)
- # beginners (17)
- # boot (216)
- # cider (13)
- # cljs-dev (4)
- # clojure (103)
- # clojure-berlin (2)
- # clojure-dev (18)
- # clojure-italy (14)
- # clojure-japan (1)
- # clojure-nl (4)
- # clojure-norway (1)
- # clojure-russia (8)
- # clojurescript (291)
- # clojurex (12)
- # datomic (31)
- # editors (1)
- # events (16)
- # hoplon (60)
- # jobs (1)
- # ldnclj (85)
- # luminus (15)
- # onyx (2)
- # re-frame (18)
- # reagent (36)
- # remote-jobs (3)
- # yada (3)
Hi, any guidance on setting up a rest api using datomic? I see ring and some other libs, any pointers on where I should start?
Is it possible to easily use NPM libs from Cljs? E.g. I want to use this Firebase Queue Worker thing, but without writing JS: https://github.com/firebase/firebase-queue
Hi, how I can escape double quotes sign (") in clojure string?
str.replace(/\"/g, '\\"') analogue in JS
(defn escape-double-quotes [str]
(s/replace str #"\"" "\\\\\""))
@petrus it’s not straightforward, there’s some ongoing work that will make it simpler for build tools to consume NPM, but it’s not going to be an officially supported thing.
in the case of Firebase you shouldn’t need NPM anyhow, http://cljsjs.github.io
@curtosis it’s not desirable to write a function for those cases, you want Google Closure to optimize that stuff. If you’re actually dealing with JSON data then there’s goog.object
which has all the helper fns one would need.
Not 100% sure, but I think you could do something like:
(def GenericMap {})
Hi everyone, I’ve came across this code from https://github.com/suprematic/khroma README
(runtime/send-message msg {:extensionId “some..”})
which is implemented with (https://github.com/suprematic/khroma/blob/master/src/khroma/runtime.cljs#L91)
(defn send-message [message & options]
(let [{:keys [extensionId options responseCallback]} (apply hash-map options)]
…
So the implementation says the proper usage is in fact`(send-message msg :extensionId “some”…)` which contradicts the readme. It feels weird to me to pass around options like this, especially since message will mostly be a hashmap, so it’d be better written like in the readme. Which one do you think is the most meaningful/idiomatic ? (send-message msg {:foo “bar"})
or (send-message msg :foo “bar”)
?Do you know the keys in the map?
@dnolen: thanks! I figured there had to be a good reason ... too many of us Lispers around to leave something like that un-abstracted repeatedly. 😉
trying to understand how transit works - if msg
is the string representation of a ClojureScript map (sent from client to server using transit-cljs and a websocket) what is the simplest way to parse msg
back into a Clojure map on the server side?
@paulb not sure I understand the question. If you use transit-clj and transit-cljs there isn’t anything to do, it just works