Fork me on GitHub

@sandbags yes cache scares me every time during development, will be glad to hear feedback for 0.4.4


@andre yeah i'm never quite sure why the cache holds on to things sometimes and not others


Hi guys, here's the thing that bothers me a lot (I'm a cljs newbie). If I'll start a re-frame project, I would need a datagrid mostly. I mean, a list component with sorting, filtering, column resizing, infinite scrolling, pagination, exporting to CSV etc. stuff. I'm coming from Angular, where there is brilliant ui-grid that covers all this kind of stuff, while being stateful, mutative, and certainly not FP-oriented. I've found a close alternative in the React world: AG Grid,, which is really powerful and free. Can I use it with re-frame, regarding it's FP ideas?... And, what datagrids are you using? And maybe there are some examples of datagrid-apps built with re-frame?


@markel there is a re-frame-data-table component you could look into


i've not got around to using it myself yet so i am not sure how good it is or how it might compare to existing solutions


in general you can use stateful JS components in re-frame by wrapping them, that's in the docs ... if you can't find it i can dig up a reference


(essentially you create a reagent component that wraps the JS component and acts as the conduit between a re-frame subscription and JS land)


@sandbags Thanks! >you can use stateful JS components in re-frame by wrapping them that's what I wanted to hear 🙂 I'm still in progress of reading the docs, so I'll get there soon.


Great, thank you so much!


Has anyone else implemented the lists/grids in their re-frame (or any cljs) apps?


I've found the Google Maps example, in practice, a little hard to translate into my own context. I think because it's a little more complicated and I'm not sure how to simplify, although conceptually the process seems simple enough. I suspect I just need to find an hour to play with it properly.


(also I am essentially ignorant of the React underpinnings beyond the minimum required to use reagent/re-frame at all)


@markel this presentation may be useful ... it discusses visualized grids and introduces some React components for that: (it gets interesting from React components are usable from Reagent, sometimes easily, sometimes with more fiddle (because of clj <-> js data transforms)


As an example of React component interop, here is a recent example of using Chartjs Warning: the amount of chat history kept by slack is short, so that example code will disappear within a day or two.


is it madness to dispatch an event from a subscription?


Stupid question. Is a re-com/h-box supposed to be used with only box elements? Is it still correct if I were to use re-com/label for example, as the child?


@petr: It's been a while, but I'm pretty sure that h-box expects children that are styled correctly to be used in flexbox - so they might work directly depending on their style, but if they don't then you can wrap them in box and they should be good. I'm pretty sure I've always just wrapped elements in box to make sure I didn't miss any edge cases.


@isak yes, it is madness.


@shaun-mahood Thanks for teh response. That's probably the better way to go


They do work directly without the box. I was just unsure of which would be the cleaner way


I'm having trouble getting a couple of the attributes outlined here to work: :gap for example. For the life of me I cannot get there to be a space between teh boxes


Am I missing some sort of styling?


@isak my guess is ... you'll be wanting to do this (dispatch in subscription) because a newly-shown view/panel needs some data.


@mikethompson I see. The problem i'm trying to solve is recomputing one part of state if some other parts change. I saw the on-change interceptor, but that introduces 2 problems. 1) Need to intercept quite a few places, but not all 2) Didn't see how I could debounce the computation. Any suggestions?


So when X changes you want Y to be dispatched ?


Now obviously X can only change as a result of an event handler running


So the first response is to say: do the dispatch in the event handler which changes X


But the push back is: X is changed in a number of places


My problem is there are very many handlers that changes X


So then the design shifts to ... you can put an interceptor on "those many handlers which change X"


The interceptor can check for changes to X and, if found, dispatch Y


That way you "factor out" the check on X


(into the interceptor)


What if the check isn't the problem, but the number of places?


@petr: Have you tried copying the page source from that example?


If there was a way to write a subscription that was debounced, that would make it so I could use subscriptions instead of manipulating app state


It seems like it would also be better than hunting down and maintaining interceptor for 10+ events


The solution in that comment I don't think would solve my problem, because aren't the computations immediate?


Not re-frame specific, but reagent question here. I’ve noticed that sometimes such definitions makes huge difference:

(defn concrete-container-1 [view-component]

(def concrete-container-1
  (partial generic-container
specifically one with partial does not work properly (something like double rendering) is there any explanation/documentation for that?


@shaun-mahood I haven’t, I’ll give it a try