DEV Community

Discussion on: You Might Not Need Vuex with Vue 3

Collapse
 
sonicoder profile image
Gábor Soós

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.

Collapse
 
ozzythegiant profile image
Oziel Perez

This is why one must try their best to ensure that with a tightly coupled store, such stores are only used at top level components, leaving the rest to be dumb components used only to display data or emit an event