loading...

re: You Might Not Need Vuex with Vue 3 VIEW POST

TOP OF THREAD FULL DISCUSSION
re: What is the benefit of provide/inject compared to directly import { state } ?
 

The second import solution creates a tightly coupled store, which makes testing, using another store with the same interface, using different stores in different parts of the application hard.

Both solutions work. The second one is simpler but hardly coupled to the implementation. The first one is a bit more complex but makes the code more open to alteration.

Code of Conduct Report abuse