Fork me on GitHub
#re-frame
<
2020-06-23
>
somedude31402:06:18

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?

mikethompson02:06:14

@somedude314 The simple example, uses reg-event-db

mikethompson02:06:26

And not reg-event-fx

mikethompson02:06:51

So that means the event handlers only ever return an updated value for app-db

mikethompson02:06:57

So that's teh only effect

mikethompson02:06:28

IF it used reg-event-fx instead, then the event handlers could return other effects

mikethompson02:06:49

And, in that case, you might have needed to register effect handlers for those other effects

mikethompson02:06:47

But, as it happens, there's a built-in effects handler for app-db so you don't need to supply it

mikethompson02:06:09

That's a built in effect

mikethompson02:06:22

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
    ....
    ))  

mikethompson02:06:09

It is all explained on the page you are reading http://day8.github.io/re-frame/Effects/

mikethompson02:06:18

@somedude314 ^^

somedude31402:06:06

Thanks a lot, I think I understand now. Will definitely go over the docs.

m97215:06:43

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?

lucio17:06:00

Chartjs react works great with re-frame

mikethompson22:06:05

@ 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.

manas.marthi16:06:38

hey, did anyone try reactn with reagent? -https://github.com/CharlesStover/reactn