Fork me on GitHub
#re-frame
<
2015-09-23
>
mbertheau10:09:17

Are there debugging aids where updates to part of the state redraw components that shouldn't depend on that part of the state? I'm using (rand-int 10) in places to see when something changes.

darwin10:09:55

@mbertheau: for this reason I had to patch reagent’s render-queue: https://github.com/darwin/plastic/blob/master/cljs/src/main/plastic/reagent/patch.cljs btw. my logs do also benchmarking, which can be handy when your app grows bigger

Pablo Fernandez11:09:02

I created a prerendering library for re-frame: https://carouselapps.com/prerenderer/

mikethompson12:09:38

Well, it is unknown to the developers

colin.yates12:09:15

it is related to a UK research university, nothing to do with re-frame

mccraigmccraig12:09:47

is it expected that #108 will get merged, or should i avoid dynamic subscriptions ?

mbertheau14:09:31

How is (for [example [1 2]] (button-cell example)) different from (map button-cell [1 2])? I'm getting Wrong number of args (1) passed to app.widgets/button-cell for the for variant. It works if I use (for [example [1 2]] [button-cell example]). What am I missing?

colin.yates17:09:13

@mbertheau: is it about evaluation? The last for returns a sequence of [button-cell..] components. The first for and map return a sequence of the result of calling (button-cell..)

mikethompson18:09:29

@mbertheau: as colin says this will be something about evaluation (...) vs building hiccup [...]. See. https://github.com/Day8/re-frame/wiki/Using-%5B%5D-instead-of-%28%29

mbertheau18:09:46

I forgot that map returns a lazy sequence and reagent doesn't materialize it.

mccraigmccraig21:09:59

hmm. i'm finding i want to pass a function in dispatch to do swap! like updates... e.g. (dispatch [:update-group assoc :name @name]) yet i seem to recall this is regarded as non-idiomatic ... what's wrong with doing it ?

danielcompton23:09:11

@mccraigmccraig: #108 is likely to get merged, though it will be marked as experimental in the beginning. I’m pretty confident in the approach, but there may be something we’ve missed (i.e. memory leaks) which would mean we would need to back it out or find another approach

mikethompson23:09:11

@mccraigmccraig: we want events to be pure data. re-frame wants there to be "data flowing".

mikethompson23:09:54

When the events are all data, they can easily be logged, replayed, etc.