mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user