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
20 changed files with 41 additions and 35 deletions

View File

@ -3,7 +3,7 @@ import { withPluginApi } from "discourse/lib/plugin-api";
function initialize(api) {
const messageBus = api.container.lookup("message-bus:main");
const currentUser = api.getCurrentUser();
const appEvents = api.container.lookup("app-events:main");
const appEvents = api.container.lookup("service:app-events");
api.modifyClass("component:site-header", {
didInsertElement() {