This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/app/services/app-events.js
Jarek Radosz fc3a6e57e3
DEV: Drop support for removing all appEvent listeners (#14936)
Also removes "appEventsCache". (and reduces the reported test memory usage by ~33%)

There's no longer any need to remove appEvent listeners in application-instance initializers' `teardown`, as app instances are recreated before each test (in both legacy and ember cli envs)
2021-11-15 12:31:05 +01:00

14 lines
342 B
JavaScript

import Evented from "@ember/object/evented";
import Service from "@ember/service";
export default Service.extend(Evented, {
init() {
this._super(...arguments);
// A hack because we don't make `current user` properly via container in testing mode
if (this.currentUser) {
this.currentUser.appEvents = this;
}
},
});