This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-27
Channels
- # announcements (2)
- # beginners (85)
- # boot (4)
- # calva (4)
- # cider (14)
- # cljdoc (8)
- # cljs-dev (5)
- # cljsrn (10)
- # clojure (101)
- # clojure-europe (1)
- # clojure-italy (6)
- # clojure-nl (12)
- # clojure-spec (4)
- # clojure-uk (71)
- # clojurescript (119)
- # core-async (20)
- # cursive (1)
- # datascript (2)
- # duct (3)
- # emacs (19)
- # fulcro (150)
- # graphql (1)
- # hoplon (2)
- # instaparse (2)
- # jobs (1)
- # jobs-discuss (11)
- # joker (9)
- # luminus (6)
- # lumo (1)
- # off-topic (33)
- # onyx (1)
- # quil (1)
- # re-frame (23)
- # reagent (11)
- # robots (2)
- # rum (6)
- # sql (1)
- # test-check (10)
- # unrepl (1)
hi, re-frame template app lets you use secretary/dispatch! "my-route"
. However this does not change the url in the browser? What should i use for this?
@tomaas If you want to keep on using secretary
I would combine it with https://github.com/venantius/accountant to solve that issue.
Yes, if he doesn't want to abandon secretary that is a fine choice.
@tomaas I’ve messed with secretary + accountant and bidi + pushy, and it never really clicked for me at all until I came across the reitit.frontend.easy example for re-frame: https://github.com/metosin/reitit/blob/master/examples/frontend-re-frame/src/cljs/frontend_re_frame/core.cljs
Hello guys. I have some problem with specing the event handlers in re-frame. I’m doing something like this
(defn my-event
[db [value]]
...)
(s/fdef my-event
:args (s/cat :db :app/state
:event string?)
:ret :app/state)
(rf/reg-event-db
:my-event
[rf/trim-v]
my-event)
So here should be an error because event vector is not a string, but I didn’t get an error
What I’m missed?2. you’ll need to make sure you pass in my-event
to reg-event-db
after you have instrumented it
Thanks @lilactown
I’ve made a clojure.spec.test.alpha/instrument
call
But why I need to pass my functions after I instrument it. Do re-frame change it somehow?
Btw it works if I did it in order you’ve mentioned ))
But I can’t figure out how to set up this order automatically
I’m using shadow-cljs and I have a :after-load
function which calls the clojure.spec.test.alpha/instrument
function but this seems to be the wrong order
@ts1503 instrument
is a macro relying on "previous" compiler information. so it must always be called after all other code has been compiled
the easiest way to achieve is would be to have the namespace that has the instrument call depend on all the others
So when instrument replaced the function with the instrumented version, re-frame still has a reference to the old one
so basically I need to separate phases of defining handlers functions and calling the rf/reg-event-db
with instrumented versions of this functions
@sergey.tkachenko I have a re-frame wrapper I've been messing around with for a while. To work around that issue, I changed the way all the reg-*
functions work -- they only get registered after an init!
function has been called. See https://github.com/ComputeSoftware/re-structure/blob/2a8b6a2d28b92de8bbba13b9ba591fd674dc65d0/src/re_structure/core.cljc#L18-L22 and the example init here: https://github.com/ComputeSoftware/re-structure/blob/2a8b6a2d28b92de8bbba13b9ba591fd674dc65d0/examples/basic/core.cljs#L23-L24. Not sure if I actually like this idea or not. Haven't had much time to put thought into this.