DEV: provides a way to hook into createWidget constructor (#8340)

This commit is contained in:
Joffrey JAFFEUX 2019-11-13 09:29:12 +01:00 committed by GitHub
parent 38a18b7aa0
commit e4df3792f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -118,6 +118,8 @@ export default class Widget {
this.appEvents = register.lookup("service:app-events");
this.keyValueStore = register.lookup("key-value-store:main");
this.init();
// Helps debug widgets
if (Discourse.Environment === "development" || ENV.environment === "test") {
const ds = this.defaultState(attrs);
@ -144,6 +146,8 @@ export default class Widget {
return {};
}
init() {}
destroy() {}
render(prev) {