Fork me on GitHub
#re-frame
<
2017-03-09
>
danielgrosse11:03:31

Is ist possible to create a cursor to a component, which I could save in the re-frame db, instead of the whole component?

sandbags16:03:31

@danielgrosse what do you mean by "cursor to a component"?

pandeiro18:03:04

having been away from 0.6.0 to 0.9.2, what happened to the need to use reagent.atom/reaction inside subscription handlers? or is that still a thing? (i don't see it in the README anymore)

shaun-mahood18:03:01

@pandeiro: Lots has changed since then - read through https://github.com/Day8/re-frame/blob/master/CHANGES.md first, probably worth reading through the new README and docs as well. Huge improvements and it's a lot nicer to use now.

pandeiro18:03:56

thanks @shaun-mahood I've been doing that in bits and pieces; this was just one major change that I didn't see specifically explained anywhere

pandeiro18:03:00

I'll keep reading though

pandeiro18:03:13

(and I agree, the API is nicer for it!)

pandeiro18:03:22

yup, just got there 🙂 thanks shaun

shaun-mahood18:03:08

@pandeiro: If you're interested in watching video on it, I think you might find something useful in my talk from the last conj - although it was meant for everyone, my own context came from learning 0.6 -> 0.9 and so most of it should be pretty relevant for your own path (though I haven't been able to bring myself to actually watch it yet, so I can't guarantee the quality... 🙂 )

pandeiro18:03:42

thanks that sounds like a good investment -- the link to the develop branch's docs (in that same 0.8.0 changelog item) is a little bit 😮 just b/c of how much stuff there is there

shaun-mahood18:03:59

Yeah there's a lot there - the changes have been pretty amazing as far as how much they've improved the few main issues I ran into with 0.6, but the fundamentals are still very much the same. It was a pretty impressive amount of work that Mike and Daniel put in.

PB20:03:36

Hey all. I"m trying to figure out how to pass query-params to my panels I have the router setup as such

(defroute "/job/:job" [job]
    (re-frame/dispatch [:set-active-panel :job-panel]))
The only way I can think to past job-id to my db atom and access it from there, but that has obvious race conditions. I feel like I'm missing something obvious

alanspringfield20:03:49

@danielcompton @mikethompson @shaun-mahood Have you thought about adding an option to use Datascript as the app-db? How difficult would it be to implement?

danielcompton21:03:05

There is https://github.com/Day8/re-frame/issues/151. We've thought about it, but have no particular need for it ourselves. It would be fairly easy to swap out app-db for datascript, you would just make a new reg-event-ds function which injects your datascript db and applies modifications after the event. It doesn't even need to be part of re-frame core, as all of the raw primitives are there for you.

PB20:03:35

So I'm still confused on how to pass query params to my view, can anyone explain this to me, please/

PB20:03:54

I have tried adding the job to the dispatch, as such

(defroute "/job/:job" [job]
    (re-frame/dispatch [:set-active-panel :job-panel job]))
but I'm unable to access it using (re-frame/subscribe :active-panel) I really feel like I"m missing somthing obvious