3 ms·
Personally I have enjoyed Pinia the most when working with Vue projects: https://pinia.vuejs.org/ https://pinia.vuejs.org/ It is simple (no need for lots of bo
by KronisLV 4y ago
Personally I have enjoyed Pinia the most when working with Vue projects: https://pinia.vuejs.org/ https://pinia.vuejs.org/
It is simple (no need for lots of boilerplate code), reasonably performant, integrates with the browser Vue dev tools nicely and is just generally a pleasure to work with, especially because Vue does a few things better than React in my eyes - most notably, the hooks.
Pinia in particular also seems to generally get out of your way and doesn't enforce a particular architecture upon you. Want to add methods to the store to interact with an API and not have to think about that in your other components, merely call a method for initializing some data from the API that will take care of the store state? Sure! Want to do the opposite and only use the store for persisting data, regardless of where it's initialized? Go ahead. Want to have your components react to changes in the store? This will work with either approach.
This is subjective, of course, but personally that combination of tools has resulted in a pretty good development experience, in my eyes something like the following is a nice stack:
- Vue 3 with Composition API (hooks)
- using SFC with <script setup> (takes care of some boilerplate)
- using Pinia for state management
- using PrimeVue or a similar component library (to have ready-made components for most needs)
For React, I have to say that MobX was nice last I checked: https://mobx.js.org/README.html https://mobx.js.org/README.html though React's own Context functionality is also okay: https://reactjs.org/docs/context.html https://reactjs.org/docs/context.html
- amoerie 4y agoI've been working on a large React + Mobx codebase for nearly 3 years now, and it's still holding up surprisingly well. Mobx is really well designed and plays nicely with React. I haven't encountered anything more appealing than this combo yet (Admittedly I haven't tried Vue yet)