Re:Reagent 0.5.0 – Minimalistic ClojureScript interface to R...
by bkurtz13 on Friday March 13, 2015 @02:53PM
(#9199139)
Take a look at Prismatic's om-tools(1).
It adds a defcomponent macro that removes a lot of boilerplate.
Re:Reagent 0.5.0 – Minimalistic ClojureScript interface to R...
by astine on Friday March 13, 2015 @03:18PM
(#9199335)
I actually used om-tools before I switched to reagent. Om-tools does cut out a lot of boilerplate, but I like reagent's approach more from the outset. One thing I found confusing about Om with or without om-tools, was how to manage communication between the components. The tutorials used a lot of core.async to manage that but it was clearly unnecessary.
In Reagent you can pass arbitrary parameters to component functions. You don't have to make each component correspond to a branch on your applications state's tree. You can, and you can use a cursor analog if you want to, but you don't have to and I found that very freeing.
The other major change is that state is managed through a special, customized, reactive atom. Everytime the atom is updated, any components which use it are updated. You can have as many of these atoms as you want and you can use them from as many components as you want.