This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-05
Channels
- # announcements (1)
- # babashka (3)
- # beginners (4)
- # calva (9)
- # cider (12)
- # clj-kondo (53)
- # clojure (64)
- # clojure-austin (1)
- # clojure-dev (3)
- # clojure-europe (4)
- # clojure-norway (3)
- # clojurescript (8)
- # conjure (11)
- # datalevin (47)
- # datomic (28)
- # emacs (7)
- # gratitude (2)
- # hyperfiddle (74)
- # introduce-yourself (1)
- # kaocha (6)
- # lsp (13)
- # malli (5)
- # off-topic (1)
- # practicalli (1)
- # re-frame (31)
- # shadow-cljs (24)
- # tools-build (4)
- # vim (2)
- # yamlscript (8)
Hello, I am a total noob learning about re-frame as it's in the shadow-react-native template I cloned. My question: it seems that most of the re-frame capability can be easily replicated using one ratom and built-in core.async functionality such as channels. Why do I want to use re-frame as opposed to just reagent and built-in async? My bias is to critically evaluate whether a dependency is really needed, especially when it makes the core of the project
Why re-frame? Well, undisciplined use of Reagent can lead to a confusing spaghetti. This problem is completely solved by re-frame. In a nutshell: re-frame imposes discipline on the use of Reagent.
What kind of discipline is imposed besides using a single atom as the database, a practice I am already familiar with from React and would have done anyway?
Subscriptions, events, effects, interceptors etc.
> completely solved Not completely. Otherwise, there wouldn't be any all-encompassing issues on GitHub. ;)
@U05D3EAA6FM wrote: "What kind of discipline is imposed besides using a single atom as the database..." I do not see it in the doc now, but there used to be a "why re-frame" argument suggesting a dev not using re-frame would end up reinventing it, so they may as well use re-frame. But that confirms your assessment that you can easily do without re-frame, rolling your own solution. You might even come up with sth better. All that said, I am surprised by the implied assessment that re-frame does not impose more discipline than using a single atom. Indeed, it sounds like you are hoping to avoid the re-frame disciplines! I say go for it, come back to re-frame if you change your mind.