Hi Albert | sorry for the late reply due to holiday
HiAlbert,sorryforlateresponse.Iwasonafamilyvacationforalmostamonth.IsEventBusconsidereda“hack”shortcut?Idon’tthinkso.It’sanalternativewayofcommunicatingbetweencomponents.Actually,EventBusfollowsthePubSubconceptyouhavementioned.IhaveseenthetermEventBusmanytimesinmylifeandIlikehowitcommunicatesit’spurpose,tocarryeventsfromonepartoftheapplicationtoothers.Likeabus.Inmyopinion,EventBushassomeadvantagesinasmalltomediumsizeapplications.First,it’snottiedtoaparticularparentcomponent.SowithEventBus,we...
Hi Albert, sorry for late response. I was on a family vacation for almost a month.
Is EventBus considered a “hack” shortcut?I don’t think so. It’s an alternative way of communicating between components. Actually, EventBus follows the PubSub concept you have mentioned. I have seen the term EventBus many times in my life and I like how it communicates it’s purpose, to carry events from one part of the application to others. Like a bus.In my opinion, EventBus has some advantages in a small to medium size applications. First, it’s not tied to a particular parent component. So with EventBus, we can pass events between multiple components living in different parents. Second, it’s easier to implement compared to vuex.