Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have been successful by instantiating separate services to perform REST operations and a global event emitter to establish communication between all the services and all the components that relate to these services in any way.


I cringe when I hear the words "global" and "event" together in the same sentence. Projects I've worked on in the past that relied heavily on global events often became a maintainability nightmare.


Why? Please share your experiences. I don't understand what's the utility of event emitters if not for serving as glue to all the separate components of an app. Am I wrong?


You're not wrong. It's definitely one way to solve it. I just find it harder to jump into a project with heavy reliance on global events and be able to quickly understand what's going on. It gets even harder if you have events firing other events.


> I just find it harder to jump into a project with heavy reliance on global events

Harder than what?


Harder than the way that it is done in Angular, via services.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: