Where is the code for Domino 3 here: https://github.com/day8/re-frame/blob/master/examples/simple/src/simple/core.cljs? Does it happen automatically?
@somedude314
The simple
example, uses reg-event-db
And not reg-event-fx
So that means the event handlers only ever return an updated value for app-db
So that's teh only effect
IF it used reg-event-fx
instead, then the event handlers could return other effects
And, in that case, you might have needed to register effect handlers for those other effects
But, as it happens, there's a built-in effects handler for app-db so you don't need to supply it
The :dispatch here https://github.com/day8/re-frame/blob/master/docs/Effects.md?
That's a built in effect
So somewhere in re-frame is does this ...
(re-frame.cosre/reg-fx ;; <--- API for registering an effects handler
:dispatch ;; <--- the effect for which we are registering a handler
(fn [val] ;; <-- the handler which will action the effect
....
))
It is all explained on the page you are reading http://day8.github.io/re-frame/Effects/
@somedude314 ^^
Thanks a lot, I think I understand now. Will definitely go over the docs.
hello there! I’m very excited with functional programming and decided to learn a functional language. I’ve been studying Clojure for a week, as a challenge, I want to port this personal project I was building with choojs and xstates. https://twitter.com/marlus/status/1247186858209050625 https://github.com/sulram/flowing Do you recommend a state chart lib to use with re-frame? Is there a book about re-frame?
hey, did anyone try reactn with reagent? -https://github.com/CharlesStover/reactn
Chartjs react works great with re-frame
@m972 The book on re-frame is here: :-) https://day8.github.io/re-frame/ Be sure to also look in here for other written material and video courses: https://day8.github.io/re-frame/External-Resources/ xstate is a very sophisticated library, and there isn't an equivalent for re-frame. Libraries like Chartjs and VegaLite (the one we use) are straight-forward to integrate.