This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-07
Channels
- # beginners (19)
- # cider (20)
- # cljs-dev (2)
- # cljsjs (2)
- # clojure (61)
- # clojure-spec (13)
- # clojure-uk (12)
- # clojurescript (12)
- # core-typed (1)
- # cursive (16)
- # data-science (30)
- # datomic (37)
- # fulcro (8)
- # hoplon (7)
- # jobs-discuss (1)
- # onyx (21)
- # planck (18)
- # protorepl (1)
- # re-frame (2)
- # reagent (1)
- # shadow-cljs (6)
- # tools-deps (4)
I have found that the autogensym reader macro is not applied on quoted code, e.g. 'x# yields the symbol x# rather than x__auto__1234 or similar. However other reader macros are evaluated inside of quoted code. Is there any significance to this behavior or is it an unimportant detail?
@jayvmithani x#
isn't a reader macro, it's a feature of syntax-quote (`) in particular
So, I have this function that is probably wrong for multiple reasons, I'm trying to learn hugsql with little sql experience and I do not like how this function looks.
(defn update! [{id :id
username :username
api-key :api_key
email :email
password-hash :password_hash}]
(when-some [x username] (update-username! id username))
(when-some [x api-key] (update-api-key! id api-key))
(when-some [x email] (update-email! id email))
(when-some [x password-hash] (update-password-hash! id password-hash)))
I have individual functions to update each column I want to be updateable, and it seems easy to just when-some do the update, but this is fugly. Does anyone have any suggestions?Unless anyone knows if it's possible for me to do something in hugsql where I can supply a map and update only the supplied keys with the sql.
@alice so you're thinking of giving it the whole map but only want to update certain columns?
Well, I was unable to write hugsql/sql functions that update more than one column at a time, but this may be a me problem and not a hugsql/sql problem
and because I was only able to update one at a time, I decided a general update function would be appropriate to handle all
are there any code highlighting libraries in clojure (or java) that are preferably simple and light? ideally something i could use like (highlight lang text)
. clojure and ruby support is a must, the more the merrier. do you know of anything like that?
[:form {:on-submit on_click :class "my form"}
How to prevent page reload when I click enter in my form?is this using reagent?
the reason I ask is because I assume the reload is being caused by your DOM rendering framework
oh, sorry, you are seeing a reload, as in hitting the backend instead of a re-render of the page?
@ihorgorobets I haven’t used rum, but I think adding that preventDefault
to submit
event should be enough