Fork me on GitHub
#re-frame
<
2016-02-26
>
mccraigmccraig01:02:12

@dfcarpenter: either as a parameter to the reagent component function, or as a re-frame subscription referenced from within the component function, or some combination, where sub params are passed in as component function params

dfcarpenter01:02:34

@mccraigmccraig: if I add a parameter to the top-level reagent component fn (say :home-panel [id] ) how would I alter the existing :set-active-panel handler and possibly also the panels multimethod to do this?

mccraigmccraig10:02:35

@dfcarpenter: dunno... not sure what you are trying to achieve. if you just want to add a param to the home-panel and not the other panels selected by the multimethod then you are perhaps better off using a sub from the home-panel, and then setting the data for that sub in the app-db with some other handler

dfcarpenter16:02:33

@mccraigmccraig: Thanks. That’s what I ended up doing for now. My original intent was to reduce some boilerplate by having one component handle the rendering of 4 different 2nd level maps belonging to an object. It would know how to reference the map it needed by the parameter passed in the route (such as “/item/:id”) and using the routes parameter as a parameter for the components re-frame/subscription.