Fork me on GitHub
#re-frame
<
2018-01-09
>
justinlee00:01:57

In the re-frame documentation, they stress that in “form-2” components, one must repeat any parameters in the inner function, because otherwise the render function won’t get updated props. This is confusing because in react, render functions do not get parameters. They reference props. Given that there are no props in form-2 components, I don’t even see how new “parameters” could even be provided. Does anyone know what’s going on here, or where in the source I could look?

mikethompson01:01:18

@lee.justin.m sounds to me like you are working your way through the docs at the bottom of this page: https://github.com/Day8/re-frame/wiki#reagent-tutorials

mikethompson01:01:33

Sounds as if you are on the first document.

mikethompson01:01:49

I'd just keep going with the rest, despite this confusing you

mikethompson01:01:16

I suspect that the "When do components update?" will tie it together for you

mikethompson01:01:22

When you get there

justinlee01:01:28

@mikethompson thanks yea. that’s what I was looking at. I’ve puzzled through the source and some of the reagent updates and I think I get what’s going on.

mikethompson01:01:13

In summary: when a parent component rerenders, it can supply new props to the children

mikethompson01:01:45

So the child can get an initial set of props, and then later, when the parent rerender, new props

mikethompson01:01:03

new prop values, that is

justinlee01:01:30

that makes sense to be because i am familiar with react from a JS context. what i didn’t get was that all forms of reagent components get turned into full-fledged classes. i didn’t think that was possible given that i was supplying a function but i underestimated the wizardry of reagent 🙂

justinlee01:01:19

its a really subtle thing because it looks like it is just a function that returns data but there is so much more crazy stuff going on

justinlee01:01:58

if i had one thing I could change it would be some reagent documentation that told me what it was doing instead of how to use it

mikethompson01:01:21

@lilactown citrus is something of a re-frame clone for RUM. I'm not a fan of some of the design decisions, like their use of multimethods. But I'm nitpicking. It will get you close. https://github.com/roman01la/citrus

mikethompson01:01:18

@lee.justin.m hopefully the rest of the docs will make it more solid for you

mikethompson01:01:07

All seems pretty second nature to me :-)

mikethompson01:01:26

And so too the professional courses, if you want to pay.

justinlee01:01:26

Actually, after digging into re-frame, I’m actually of leaning towards reagent without re-frame (I know its weird that I asked here, but it was re-frame docs that confused me and this group seems more active). For a medium sized project, the levels of indirection in re-frame seem like a lot of firepower and a lot of cognitive load. I quite like the r/atom and r/cursor mechanism. It seems to me I can just use normal functions around the state object and let reagent take care of the rest. Maybe that’s the wrong decision. 🙂

justinlee01:01:34

thanks for the link, I’ll check it out

mikethompson01:01:55

Yeah, we get that abit.

mikethompson01:01:04

So much so there's an FAQ to address it

justinlee01:01:22

If you’re curious, I basically balked at creating proxy objects in “effectful handlers” to keep things purely applicative. (as here https://github.com/Day8/re-frame/blob/master/docs/Talking-To-Servers.md#version-2) I just felt I’d spend more time debugging mini-DSLs than getting real work done

mikethompson01:01:08

Yep, all good. Our FAQ entry is because you're not the first person :-)

mikethompson11:01:27

@deg I was wondering how you were going with firebase?

mikethompson11:01:42

I'm cycling back to look at it after a long absence and I'm seeing a ton of new features. Including fancy queries on the realtime database. It all looks terrific. But i was wondering what the reality was like :-)

mikethompson11:01:23

If you have any insights, including gotchas, I'd be every interested

cmal12:01:51

Hi, are there any examples to use some cljs-d3 library such as with re-frame? I am working on a data visualization webpage (using re-frame) and searching for an example.

manuel12:01:01

@cmal I did something using d3 with no library here: https://github.com/7bridges-eu/carter

cmal12:01:28

Thanks @manuel

manuel12:01:54

no problem, have a look at graphs.cljs in particular

cmal12:01:59

I must do complex interaction with svg, listen to reagent/re-frame ratom and be reactive to user interaction and the generated state by user actions and ajax data.

manuel12:01:42

well, I did only a couple of graphs to be honest, but you can see how d3 is used within re-frame and expand on that yourself 🙂

cmal13:01:27

Ahh, saw the code. Thank you!

deg18:01:13

@mikethompson I'm using my Firebase stuff in one project, Trilystro. I'm pretty much happy with the way it is behaving, and am just changing the library incrementally as I need new features. I would love feedback; single-user libraries tend to accumulate problems that are only caught by more eyes.