Fork me on GitHub
#reagent
<
2017-04-07
>
benbot14:04:10

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?

pesterhazy15:04:40

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

pesterhazy15:04:55

It should give you a pretty good idea

jimberlage15:04:13

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.

souenzzo15:04:24

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

mikethompson22:04:13

@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.

jimberlage21:04:05

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.

jimberlage21:04:16

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.

gadfly36122:04:21

☝️ 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