Fork me on GitHub
#clojurescript
<
2023-08-05
>
Nim Sadeh16:08:07

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

phill17:08:43

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.

Nim Sadeh18:08:17

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?

nikolavojicic18:08:08

Subscriptions, events, effects, interceptors etc.

p-himik20:08:34

> completely solved Not completely. Otherwise, there wouldn't be any all-encompassing issues on GitHub. ;)

kennytilton22:08:46

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

valtteri07:08:35

EDIT: moved the message to more specific thread on #re-frame