On Oct 23, 2014, at 6:04 AM, Colin Yates <colin.ya...@gmail.com> wrote:
> In terms of reagent is it true to say that it is a bit less opinionated about 
> these things and where-as om has a very opinionated approach to front-end 
> state management (happening to use om), reagent is a (very nice) wrapper to 
> om? Not to trivialize reagent, but is is "simply" trying to introduce 
> clojurescript to react?

We started off with Om / Sablono at World Singles and then switched to Reagent. 
Learning Om first _really_ helped us understand how React.js works but we felt 
that there was a lot of boilerplate with all the `reify` and method 
declarations, as well as the (then) restrictive argument lists and state 
management (since partially addressed with reference cursors). It all worked, 
it was all consistent, but it was just a lot of (extra) code.

Switching to Reagent allowed us to keep the same Hiccup-style DOM generation 
without an extra library, as well as dramatically simplifying our code base. 
Reagent made it much easier for us to manage local state, as well as passing 
arbitrary pieces of state down the component tree (because of allowing 
arbitrary argument lists). On the other hand, when you need to break out into 
React.js's lifecycle methods (e.g., when embedding D3 components), it's a bit 
more painful / ugly / inconsistent in Reagent than in Om.

> Is it also true to say that whilst om wants to manage the whole application, 
> reagent allows you to think about disconnected bits of your app?

I think ref-cursors will change Om quite a bit in that area but basic Reagent 
has no cursors and that is a drawback. I submitted a PR to add a simple cursor 
to Reagent - it's been merged to master but not yet released (although it's in 
whoops/reagent 0.4.4-alpha). We rely on this pretty heavily to pass views of 
the global state down into components, so that we can have very modular code.

I would definitely recommend building a small-to-medium app using both 
approaches and see which you prefer. Om is a fantastic piece of work and has 
really blazed a trail, but Reagent may suit you better, depending on what 
you're trying to build and what style of ClojureScript code you prefer.

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)



-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to