Fork me on GitHub
Eric Ihli16:01:05

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.

🤙 4

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?


I think it largely depends on whether re-frame data model suits you or not. It has some great features that may or may not be relevant to your projects. And it has some nasty drawbacks that just as well may or may not be relevant.