Fork me on GitHub

I’ve heard some bad things about reagent’s ratom thing, but I’m pretty new to clojure so I’m not sure what the big deal is. What is ratom and why don’t some people like it?


Try the Reagent docs, or re-frame's tutorial


It should give you a pretty good idea


The big concern I've heard is that things get slow with lots of event listeners - lots of components referencing an atom will create lots of event listeners, which will slow things down. I wouldn't worry about it too much. AngularJS scopes, RxJS observables, etc. will all have similar issues. You just have to find a happy medium between reactivity and speed, regardless of your frontend framework.


I was curious to know these "bad" things about the ratom


@benbot @jimberlage Puzzled. I've been following reagent since the beginning of time and, in this forum at least, I don't ever recall a discussion where people expressed a dislike for ratoms. I regularly express a dislike of cursors, but that's an architecture thing.


I’ve mostly come across it when using Clojurescript for a new single-page app. Sometimes we encounter performance issues related to too many things listening for changes to the same data, and people chalk it up to being a framework problem. I usually have to just do some simple performance tweaks and tell people it’s a limitation of single-threaded browser JS.


The criticism typically comes from people coming from JS to CLJS, not from CLJS users. They’re more likely to interpret performance issues as being a result of CLJS.


☝️ this is all I've witnessed too

Oliver George23:04:06

Is it possible the negativity is around using many ratoms vs one ratom to rule the all.

Oliver George23:04:36

I should be more specific and say that they may be appropriate inside of you views for local state but def'ing ratoms in your ns fragments app state