Re:React's UseRef Deep Dive
by timhwang21 on Thursday December 17, 2020 @06:45PM
(#25462018)
> it might be better to just be a standalone library
See: https://github.com/reduxjs/redux, among others.
The React ecosystem did exactly this for the past few years, but evidently it was decided that a more native approach like hooks were better.
Re:React's UseRef Deep Dive
by valenterry on Thursday December 17, 2020 @08:50PM
(#25462898)
I know redux, but I believe that there should be an even more low level library.
Coming from the backend, I miss something like the effect system builtin in Haskell/Purescript or added as a library to languages like Scala (e.g. https://typelevel.org/cats-effect/) or Kotlin (e.g. https://arrow-kt.io/docs/effects/io/)
Re:React's UseRef Deep Dive
by schwartzworld on Saturday December 19, 2020 @09:39AM
(#25477662)
Hooks are not an alternative to redux, although you could use then as one.
Personally, any time anybody has ever suggested using redux I have always fought it. I've never seen the news for a global state management library, since react has always had tools to manage state built in.
It sounds to me that such a concept would be very useful in a lot of contexts, so instead of specializing it only to react hooks, it might be better to just be a standalone library. E.g., why not use the same technique in Angular?
That way, developers don't have to learn framework-specific ways of doing things again and again but can reuse their knowledge. I think the fact that everyone is building their own thing is one of the reasons why many people have this notion of "need to learn a new framework every half a year". Backend technology seems to do better here, maybe because the pace is slower?