cool! I find Redux/Vuex really confusing, but this EventBus method looks like a simpler solution.
You can even use this technique while still making use of Vuex.
I like it the most when I want to avoid storing extra stuff in state, like having some vue instance commit a flag, that another vue instance is watching. That would be like a vue1 -> state -> vue2 pathway.
I can instead just use the EventBus as like a side passage, just emit from 1 vue component and listen to it in the other one so I'm instead going vue1 -> EventBus -> vue2.
We’re a place for programmers to stay up-to-date, learn new skills, and share ideas.
We’ll never post without your permission.