Fork me on GitHub

@m_traven Hi, @lucio and I have been working on a native reagent datatable for the last few weeks. It’s still very much a work in progress but I think it’s better than any other options, unless you need something really powerful in which case a react library like ag grid will do anything you could think of. But if you just need a lightweight solution with client side pagination, filtering, searching and sorting then this is probably useful


Let me know if you run into any problems with it


Thanks for the tips! I tried switching over to ag-grid and so far its working pretty well.

Harish Tella16:04:35

Another option in Handsontable. We use it from reagent/re-frame. And it’s working out well for us.


ag grid is great, just make sure you understand the potential costs, it can get expensive depending on your use case


Hi all, how would it be possible to have a reg-event-fx which always execute a db operation but only sometimes executes a dispatch? In other words, something like this:

    {:db ...
     :dispatch (if ..)})
I've tried the above but it fails because I think :dispatch can't accept nil values.


Use cond->.

👍 4

Oh! Great idea, I'll try that as well.


I've done the following and it seems to work:

(let [switch    ...
         event-m {:db (assoc db ...)}]
     (if switch
       (assoc event-m :dispatch [...])


If you have medley you could use assoc-some , or merge, like

 {:db ...}
 (when switch 
  {:dispatch ...}))


Probably cond-> is better than merge but assoc-some would still be my preference