Fork me on GitHub
#re-frame
<
2018-10-17
>
mikerod01:10:16

@b2berry not much detail, but you probably have somehow managed to get multiple copies of react in your JS at same time

b2berry11:10:02

That’s the best I’ve been able to find searching the issue. I’ve seen where that’s been patched in other frameworks like ruby-react etc but not sure how I would have multiple copies of react running

valtteri11:10:36

If you’re using leininingen and your react is from cljsjs you can do something like lein deps :tree | grep react and see if some of your dependencies is transitively pulling in another version of react.

b2berry12:10:32

Good tip I’ll check that out. I’ve definitely had to do specific exclusions for some transitive deps as they would force a version downgrade on react which was pretty nasty. I’ll check that next.

mikerod01:10:44

Making bundles in separate steps or forgetting and exclude somewhere maybe.

heyarne08:10:39

how would i have a layer 3 subscription and still have access to the whole app db?

heyarne08:10:52

what i need to is the following: i have the current route in the db, for which i have a subscription, and i cache data for each route somewhere in the db, for which i also have a subscription (which works like (route-data route)). now i'd like to pass in current-route as argument to route-data, which needs access to the whole database. how do i do that?

mikethompson09:10:41

(reg-sub 
    :db 
   (fn [db _]  db))

mikethompson09:10:15

Now you can (subscribe [:db]) to get the whole of app-db

heyarne09:10:54

oh. of course.

mikethompson09:10:55

(reg-sub 
    :something 
   (fn [_ _] 
         [(subscribe [:db])   (subscribe[:blah])])
   (fn [[db blah] _] 
        ....))

mikethompson09:10:34

That subscription will re-run EVERY time app-db changes in any way

heyarne09:10:56

i see. i'll try to narrow it down maybe

b2berry11:10:02

That’s the best I’ve been able to find searching the issue. I’ve seen where that’s been patched in other frameworks like ruby-react etc but not sure how I would have multiple copies of react running