Fork me on GitHub
#re-frame
<
2018-11-22
>
oliy16:11:54

Hi all, I've written a wide ranging blog post centred on why use re-frame: https://juxt.pro/blog/posts/cljs-apps.html

🚀 1
apohorecki16:11:50

thanks! it was really interesting reading

apohorecki16:11:06

looking forward to your library for comparing devcard output with reference images

oliy16:11:15

Hope you find it interesting

Whiskas16:11:09

Can someone recommend me a good example project so i can see the folder structure and how everything is glued together?

Whiskas16:11:39

I’m interested in building a simple dashboard application using react components

Whiskas16:11:53

So i will end up having some JSX files

urzds16:11:52

@mateus.pimentel.w Where did you get that image from?

Whiskas16:11:29

@urzds, woops, i forgot to paste link too. I just edited the original message with it

mikethompson18:11:38

@oliy thanks, that is great!!

parrot 1
mikethompson18:11:10

I'll add a link to it in the docs

mikethompson18:11:36

@lucio those views of yours seem very stateful which is something to be avoided if possible. I haven't used them, but the ExternalResources document lists form libraries.

devurandom21:11:26

Why do I not get arity exceptions when I register subscriptions or events with wrong-arity handler functions? Is that some re-frame magic?

Braden Shepherdson21:11:21

ClojureScript is a little more vague about arity than Clojure, I think.

mccraigmccraig21:11:08

(vague is a better description than magic in this case)

devurandom21:11:39

Is there a way to turn that off?

devurandom21:11:59

And what are the side-effects of that?

devurandom21:11:16

In our code base almost no handler function had the correct arity...

Braden Shepherdson21:11:36

why does it matter? are you concerned it might result in bugs?

devurandom21:11:10

Bugs or performance penalty or something like that.

devurandom21:11:47

I would guess that some part of the runtime has to invest time to fix our arity at runtime?

mccraigmccraig21:11:03

@devurandom i think it comes down to a feature of the js runtime - e.g. f=function(a,b){return [a,b];} ; [f(1,2,3) , f(1)] causes no error in js

Braden Shepherdson21:11:32

yeah, it would cost performance to be strict about arity; Javascript doesn't care.

devurandom22:11:59

Ah, OK, I thought it would cost something to bring the arguments of a function into shape. Pushing arguments to or popping them from the stack or so. With additional if conditions that one would not need, if one had strict arity.

devurandom22:11:48

The re-frame docs talk about the subscription part being a graph that is only build up once someone subscribes at the end. Is there also a mechanism to propagate the need for data backwards from the end? I.e. if some part subscribes to something and that is again subscribed to something else, to make this chain end at some part that says "hey, my job is to fetch data from the network, and people require my services, I'll go to work right away"?

devurandom22:11:35

Something to make re-frame subscriptions be able to subscribe to GraphQL subscriptions at the end of the chain maybe?

devurandom22:11:57

Even re-graph dispatches "subscription" events, instead of offering actual re-frame subscriptions. That seems quite backwards.

devurandom22:11:27

Is there any way of figuring out whether something is subscribed to a subscription? An event that is dispatched when a subscription comes to life for the first time?