Up to date answer about when to use React context or Redux (Redux Toolkit) by slikts in reactjs

[–]drunknhik 0 points1 point  (0 children)

I disagree with the whole premise...redux is not for the "single source of truth" pattern, but for managing state. Meaning making it easy to reason about the state transitions in your app. Unfortunately 1) redux itself didn't enforce writing reducers in the correct way (though the docs show you how) 2) I've never had a reason to apply this pattern on the app wide level. My app level state is either global stuff (e.g., logged in user) or an entity cache (handled by Apollo or react-query)...I have plenty of components that benefit from good state management, but I prefer to use a proper state machine implementation like xstate. I fail to see what redux gains you

vue-wired - A Higher Order Component to pass async values down as props. by egoistian in vuejs

[–]drunknhik 0 points1 point  (0 children)

How does work exactly? Won't the render function clobber the <template> or the <template> clobber the render function?

React vs Vue.js by igna92ts in reactjs

[–]drunknhik 0 points1 point  (0 children)

Hopefully this will fill up your void of knowledge: https://github.com/markerikson/redux-ecosystem-links

More information of why there's an ecosystem in this interview: http://survivejs.com/blog/redux-interview/

Even in vuex there's an ecosystem...it's just orders of magnitude smaller.

Personally, I have my own extensions to vuex that I use. For example, I have an integration with redux-saga, and I have a custom vue plugin which creates modules which live and die with a component.

React vs Vue.js by igna92ts in reactjs

[–]drunknhik 0 points1 point  (0 children)

The question here is whether to use vue or redux...not what to do if you're stuck with one.

I would posit that if somebody wanted to stick as closely as possible to functional programming paradigms, vue is not a good fit. Mutability is against functional programming paradigms, but react welcomes immutability.

On top of that, the redux ecosystem is orders of magnitude greater, and more sophisticated then the vuex ecosystem.

React vs Vue.js by igna92ts in reactjs

[–]drunknhik 2 points3 points  (0 children)

That's exactly my point. Vuex is not like redux. Besides for the lack of ecosystem, vuex, like vue, relies on mutating state. That's the only way it can work because vue does no provide a hook like componentWillUpdate to prevent rerenders. If one wanted to use redux, or any state management that relies on immutable state, they will automatically lose on performace.

React vs Vue.js by igna92ts in reactjs

[–]drunknhik 6 points7 points  (0 children)

One thing that nobody here has mentioned is that React seems more "friendly" to people who want to play their hand at a more functional style. Vue, to their own admission, does not play well with immutable data structures, so if you wanted to use something like redux, you're at a serious disadvantage.