2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

REFACTOR: Move app-events:main to service:app-events (#8152)

AppEvents was always a service object in disguise, so we should move it
to the correct place in the application. Doing this allows other service
objects to inject it easily without container access.

In the future we should also deprecate `this.appEvents` without an
explicit injection too.
This commit is contained in:
Robin Ward 2019-10-04 10:06:08 -04:00 committed by GitHub
parent 5e88baebb6
commit f5d391a48a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 41 additions and 35 deletions

View file

@ -159,7 +159,7 @@ QUnit.testDone(function() {
// ensures any event not removed is not leaking between tests
// most likely in intialisers, other places (controller, component...)
// should be fixed in code
var appEvents = window.Discourse.__container__.lookup("app-events:main");
var appEvents = window.Discourse.__container__.lookup("service:app-events");
var events = appEvents.__proto__._events;
Object.keys(events).forEach(function(eventKey) {
var event = events[eventKey];