Fork me on GitHub
#reagent
<
2018-09-11
>
theeternalpulse05:09:25

For stateful rendering functions that could get quite large with handlers and such, what is the recommended course of action to keep them manageable

ghiden09:09:59

anyone know good examples of creating a react component from reagent? trying to create a reusable react component in cljs and publish to private npm repo

ghiden09:09:24

i guess it's not a typical usecase

ghiden09:09:25

thanks, yes i was looking at that one

ghiden09:09:52

couldn't find any examples

ghiden09:09:36

sweet, it works with form-3 components

enforser15:09:51

Hi, I'm running into a bit of a problem regarding the subscription cache ratoms, and hoping I can get some clarification! I'm getting the ratoms from: @re-frame.subs/query-reactionwhich returns a map of subscriptions and Reaction objects. I'm then trying to monitor the number of watchers on a subscription reaction, and I can get the watchers to increment when the component displaying the data "unmounts", the watchers persistent - the number of them doesn't ever go back to 0, unless I reload the page.

enforser15:09:11

Should (.-watches <#some reaction>) return a live count of watchers (i.e. should they be incrementing and decrementing) or am I misinterpreting how the watchers work?

enforser15:09:29

My flow:
(def reaction (get @re-frame.subs/query->reaction [[:some-key] []])))

(.-watches reaction) ;; returns the list of watchers - the problem is here, I would have thought the list of watchers would shrink when the data is no used by a component in the DOM
@reaction ;; returns the current value.

justinlee16:09:12

@trailcapital you might try in #re-frame as your question is really about that rather than reagent

enforser16:09:40

ah, true - I'll do that!

enforser16:09:52

I may have figured it out, so my repost will be pending that!

leblowl22:09:45

Hey reagent folks, are we supposed to be wrapping all of our dynamic lazy lists in doall ? (https://github.com/reagent-project/reagent/issues/91)

leblowl22:09:30

I am also curious if there is any performance trade-off for using into vs map or for. With (into [:div] ...) you no longer need to use React keys because there is no list. Does using lists improve performance by chance? I don't know much about React internals