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/mixins/cleans-up.js.es6
Mark VanLandingham 02a886ce13
DEV: Import Ember.on from @ember/object/evented (#8268)
* DEV: Import `Ember.on` from @ember/object/evented

* Dont import "on" outsie of the js or admin app

* Fixed error when resolving merge conflicts
2019-10-30 17:05:27 -05:00

15 lines
462 B
JavaScript

import { on } from "@ember/object/evented";
import Mixin from "@ember/object/mixin";
// Include this mixin if you want to be notified when the dom should be
// cleaned (usually on route change.)
export default Mixin.create({
_initializeChooser: on("didInsertElement", function() {
this.appEvents.on("dom:clean", this, "cleanUp");
}),
_clearChooser: on("willDestroyElement", function() {
this.appEvents.off("dom:clean", this, "cleanUp");
})
});