Fork me on GitHub
#reagent
<
2016-09-17
>
yury.solovyov08:09:14

how do I structure my app so that state and components are separated? on GH project page, state and components are defined in same file, so referencing each other is not a problem

yury.solovyov08:09:22

cause ATM I have circular dependency where file with state needs to require components to render, but components need state file to get the state

artur09:09:41

That's how I do it

artur09:09:53

There are some official framworks but this has worked so far for me

yury.solovyov09:09:20

I looked into re-frame

yury.solovyov09:09:33

but I don't like that subscriptions are mixed into components

yury.solovyov09:09:15

I don't know, maybe it is not that bad

artur09:09:13

In my framework only the pages are smart, components are dumb just as you wanted

artur09:09:46

components get data from parameters and not from the state and components can call actions but do not modify state directly

yury.solovyov10:09:43

in re-frame, reg-sub -supplied function has 2 args, what's the second? I need to subscribe to changes of the specific key in map

escherize13:09:10

Just a guess, but on line 12, you have ([... and I suspect that should be [… instead

escherize13:09:38

and of course remove the matching ) (probably goes without saying)

yury.solovyov14:09:37

Yup, thanks, that was right

coyotespike17:09:00

What's the best channel to ask about the Sente library, do you think? I'm trying to make the most minimal example possible, so that noobs like myself will have an easier way in.

coyotespike17:09:37

Maybe I should just open an issue to discuss.

plexus17:09:09

That's the websockets lib, yeah? If it doesn't have its own channel I'd ask in #C03S1L9DN

plexus17:09:30

It's pretty quiet in there anyway today :)

coyotespike17:09:03

Yeah, that's the one 🙂 clojurescript's probably a good place, thanks...although I may be getting the hang of it. I'll just send Peter my little tutorial when done

rodrigo18:09:27

what’s a good strategy to host an arbitrary DOM component? case in point, I want to have a div bound to a vis.Network (http://visjs.org/)