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:
parent
5e88baebb6
commit
f5d391a48a
20 changed files with 41 additions and 35 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue