This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-04
Channels
- # aatree (5)
- # admin-announcements (37)
- # alda (1)
- # announcements (4)
- # architecture (1)
- # aws (3)
- # beginners (82)
- # boot (230)
- # braid-chat (14)
- # cider (48)
- # cljs-dev (8)
- # cljsrn (31)
- # clojars (47)
- # clojure (72)
- # clojure-austin (2)
- # clojure-russia (396)
- # clojurescript (72)
- # community-development (3)
- # component (6)
- # core-async (6)
- # cursive (26)
- # datomic (42)
- # emacs (6)
- # events (35)
- # hoplon (57)
- # immutant (3)
- # jobs (2)
- # jobs-discuss (10)
- # ldnclj (16)
- # luminus (2)
- # off-topic (50)
- # om (181)
- # parinfer (285)
- # proton (68)
- # re-frame (19)
- # reagent (2)
- # ring-swagger (23)
- # yada (36)
Hey everyone. I’m trying to debug something, how do you check the current app-state from the brepl? I’m having trouble finding out any way to do this, and I bet it’s stupidly simple 😛
(in-ns 're-frame.db)
@app-db
however there’s some other debugging methods in https://github.com/Day8/re-frame/wiki
that I find better than using a REPL
@danielcompton: I knew it’d be something like that 😛 Thanks a lot!
I’m checking out some of the more advanced tracing stuff too. I just had an issue with data-at-rest that I wanted to debug
Is there a way to overload event handlers? E.g. here’s a “buy” function - https://gist.github.com/heeton/757cc24be75838caea50 - I’d like to have a default amount of 1 if the event dispatch doesn’t specify an amount to buy
I know the basic clojure way of functions with different arity, but not if it’s nested parameters like [app-state [_ item …]]
I can't test right now but I think that item will be nil so you can just put a condition like nil?
@heeton use destructuring with an :or
http://blog.jayfields.com/2010/07/clojure-destructuring.html
@danielcompton: amazing, thankyou (again)!
@danielcompton: not sure :or
applies to vector parameters (like [_ item count]
), just maps?
@heeton: just checked, it doesn't work:
boot.user=> (let [[a [b c d :or {b 2 c 3 d 4}]] [1 [2 3 4]]]
#_=> (str "a=" a " b=" b " c=" c " d=" d))
"a=1 b= c= d="
Also replied over at #C03S1KBA2 if that's helpful.@simax99: The way you pass a custom keyboard handler to re-com components is by setting the :attr
argument:
:attr {:on-key-press (handler-fn (case (.-which event)
27 (reset! showing? false)
nil))}
However in this case, there is no external access to the atom that controls the state of the [datepicker-dropdown]
popover so you're stuck, I'm afraid.
If this is really important, feel free to a) add an Issue to the Github repo or b) add a Pull Request.