This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-05
Channels
- # aleph (6)
- # announcements (2)
- # babashka (8)
- # beginners (121)
- # calva (7)
- # cider (7)
- # clj-kondo (25)
- # clojure (167)
- # clojure-android (1)
- # clojure-italy (1)
- # clojure-sweden (1)
- # clojuredesign-podcast (2)
- # clojurescript (11)
- # community-development (33)
- # cursive (23)
- # data-science (1)
- # datascript (11)
- # datomic (7)
- # emacs (12)
- # events (1)
- # fulcro (15)
- # graalvm (3)
- # hoplon (1)
- # instaparse (1)
- # malli (12)
- # off-topic (1)
- # planck (3)
- # re-frame (5)
- # shadow-cljs (61)
- # test-check (2)
How can I manually trigger an effect handler from the repl? If I (reg-event-fx :foobar ...)
then I can test it with (dispatch :foobar ...)
but if I (reg-fx :foobar ...)
then dispatch says it can't find a handler registered with :foobar
.
That's because dispatch
works only with events.
re-frame.fx/do-fx
is responsible for calling all effect handlers. However, you cannot call it in the same way you call dispatch
since it's not a function but an interceptor. How to call it is an exercise left to the reader. :)
Actually, another way to do that is to just do what do-fx
does and get the handler for :foobar
yourself with re-frame.registrar/get-handler
and call the handler with appropriate arguments.
Wanted to get some thoughts from #re-frame. I’ve used re-frame+Reagent in the past to build ClojureScript applications, however I see there’s some new libraries out there that take advantage of Reacts newer features. Is there a compelling reason to stay with re-frame+Reagent today, or would hx, uix, Fulcro work as well?