DEV Community

Discussion on: To-Do app: Composition API as an alternative to Vuex

Collapse
appurist profile image
Paul / Appurist

I've been arguing that Vuex provides little beyond the Composition API, depending on how much you use the Vuex differentiators: time travel, data access structure, and debugging.

To me, the main loss from Vuex is the structured/regulated access to data, and you have resolved that loss through your own structure above, providing a read-only state and specific methods for funneling all modifications. This makes debugging and tracing easy, when you need it. And it seems that I don't use the time travel at all, I just haven't needed it or even found it useful. It makes for an impressive demo, but benefit to me does not exceed the cost of the overhead boilerplate of Vuex, which I find makes it more difficult to debug (tracing or breakpointing Vuex dispatch vs debugging a modification function like those provided in your article).

Thank you for posting this, it is triggering a lot of thought in my mind for how I'd structure my Composition API state access; probably exactly the way you did it.

Collapse
diegolepore profile image
Diego Palacios Lepore Author

Thanks for your thorough comment about this Paul 😃.

And I'm glad it makes you think about how to structure Composition API in your projects.

Experimenting with these new features, reading your comments about it and trying to think on different approaches is quite exiting.

Cheers! ✌️