mirror of
https://github.com/koel/koel.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #543] Question: Why the Event bus on top of the Vue instance? #383
Labels
No labels
Authentication
Dependencies
Documentation
Feature Request
Flac
Help Wanted
Installation/Setup
Integration
Mobile
PR Welcome
Pending Release
Performance
Playlist
S3
Search
Sync
[Pri] Low
[Pri] Normal
[Status] Keep Open
[Status] Needs Author Reply
[Status] Needs Review
[Status] Stale
[Status] Will Implement
[Type] Blessed
[Type] Bug
[Type] Duplicate
[Type] Enhancement
[Type] Help Request
[Type] Question
[Type] Task
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/koel-koel#383
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @etiennemarais on GitHub (Feb 21, 2017).
Original GitHub issue: https://github.com/koel/koel/issues/543
TL;DR
Why are you adding an event bus on top of the Vue instance in app.js?
This is the event bus for readers that don't know.
More...
I was curious as to why you are adding an event bus on top of the vuejs instance that you render in
app.js? Are you doing something specific with the events later like publishing them to a pub/sub stream? or is it a way to separate the concerns of your application?If you would be so kind as to help me understand why the different types of events? one is a string and the other is a function?
We are looking to use Koel as a use case to build out a service and the structure is so slick and simple. Well done for this amazing work btw :kudos:
I'd like to be able to explain this to my team better mainly because I'd like to hear your architecture decision about that. In the same question I suppose I can ask about rolling your own router and why that was the case, cuz I know they going to ask me about it :)
@phanan commented on GitHub (Feb 22, 2017):
The event bus is used to communicate between distant (i.e. non parent-child) components. You'll find it used everywhere in the app.
I don't get this question. What different types of events are we looking at?
Simple :) I didn't know about vue-router (I'm not sure if it was there when I started the project, either), and since my use-case is simple enough, I decided to roll my own.
@etiennemarais commented on GitHub (Feb 22, 2017):
Thank you so much for clearing that up. I learnt a lot about event busses yesterday and why it gets used and this validates that thank you :)
As for the different types of events question. I meant the if statement in the event.on method.
vs
I was just curious about the standards you decided to follow. because our team are moving into something like this soon with VueJS. Like why wouldn't it be
user:logoutrather? Not that there is a right or wrong, just curious ;)Ah thanks for the router answer also. That makes sense, I also had to roll my own things in the past so I understand your need vs the pain tradeoff 👍 Thanks again for a great project and taking the time to answer my noobish questions.
@phanan commented on GitHub (Feb 22, 2017):
Oh, I get it now. Well, it's clearly an inconsistency on my end, simple as that :) Thanks for the catch.