This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-27
Channels
- # arachne (1)
- # beginners (31)
- # boot (84)
- # cider (9)
- # clara (2)
- # cljs-dev (102)
- # cljsrn (20)
- # clojure (254)
- # clojure-belgium (1)
- # clojure-dusseldorf (17)
- # clojure-greece (7)
- # clojure-italy (6)
- # clojure-russia (2)
- # clojure-spec (8)
- # clojure-uk (9)
- # clojurescript (93)
- # component (4)
- # copenhagen-clojurians (1)
- # cursive (24)
- # datomic (22)
- # editors (1)
- # emacs (8)
- # garden (2)
- # hoplon (357)
- # lein-figwheel (1)
- # leiningen (4)
- # luminus (27)
- # mount (13)
- # off-topic (7)
- # om (71)
- # onyx (35)
- # planck (3)
- # re-frame (53)
- # reagent (35)
- # ring-swagger (24)
- # specter (10)
- # sql (6)
- # untangled (47)
- # vim (157)
A question about spec and re-frame. I think that it is quite useful to test that my subscriptions and handlers are conforming to a spec. Would it be feasible to add a meta-data key to subscriptions and handlers that specified input, and for subscriptions, output specs? Then one could 1 Instrument this in development 2 Run tests on each subscription in a test suite 3 Do generative testing (generating handler vectors) I’ll add an issue with this if it would be worth considering
@vikeri: or maybe extend re-frame with something like fdef
, but for subscriptions/handlers?
@jstaffans Yes, that is definitely also an option
Has anyone come up with an error-capture/reporting interceptor, or how we’re supposed to handle that in 0.8? I see https://github.com/Day8/re-frame/issues/231 listed, but no responses so far.
e.g. the pattern I want is “try X; catch E; report E to somewhere else”, but that becomes harder now that interceptors do the actual invoking of the handler function somewhere else, as opposed to the previous user-land chain-of-handler-invocations, where try/catch was easy
I didn't see this, when I started re-frisk, but definitely imagined exactly the same functionality
im enjoying 0.8.0 but am a bit confused RE this: https://github.com/Day8/re-frame/blob/9a9ec3827b91513b741b4aeb2fe0781cc02d80c8/docs/Interceptors.md#the-builtin-interceptors
Unrelated: any way to get rid of this warning? https://puu.sh/rpDEg/8ad233c0b1.png
well, its hard to give any more help without any more reasoning behind why that might be there. I would just remove it and use a standard form :onSubmit, or maybe they wanted a button :onClick? hard to say.
input
(not keyword) is a custom element defined somewhere else that accepts :on-save as a prop
I'm having trouble debugging one of my event handlers; it's logging out Handling re-frame event: ["asdf"]
(reg-event-db
:username-entered
[trim-v debug]
(fn [db [username]]
(.log js/console "---> USERNAME ENTERED" username)
(assoc db :username username)))
@samueldev trim-v
quite literally removes the 1st element of the event vector. And it is running "before" debug
.
You could always make the interceptors vector be [debug trim-v]
(ie. reversed)
That way debug
will be logging the event before trim-v
alters it
But I'm still getting no app db changes triggered by...
even though my handler is pretty plain:
(reg-event-db
:username-entered
[debug trim-v]
(fn [db [username]]
(.log js/console "USERNAME SET" username)
(assoc db :username username)))
@lwhorton No good solution currently other than to hook https://developer.mozilla.org/en/docs/Web/API/GlobalEventHandlers/onerror
@mikethompson able to point me in the direction of any debugging steps RE above?
@samueldev it appears your old db
is testing =
to your old db
Not sure why
@lwhorton a small update: https://github.com/Day8/re-frame/issues/231#issuecomment-249979258
@johanatan yes, re-frame 0.7.0 is compatible with reagent 0.6.0
@andre I'd very much like to add an intrumenting interface to re-frame. One which would allow a piece of code to be told when certain events in re-frame happen. For example "starting to handle event [:a :b]". Running subscription [:get-user 42]
Then, this code could build up a data structure which captures this instrumentation data. Which itself could then be shown via something like data-frisk.
Obviously the code which is capturing the instrumentation data doesn't have to simply record it (otherwise good old console is good enough) but instead can build up a custom data structure.
@mikethompson: okay, thanks. Do you know if both will work with the latest version of React?
i.e., if I use :exclusions to prevent them bringing in React and then manually bring in the latest version myself
re-frame doesn't depend directly on React, so the question is more if Reagent 0.6.0 will work with the latest React, and the answer to that is yes
@mikethompson awesome, thx!