mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +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:
@ -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() {
|
||||
|
Reference in New Issue
Block a user