Skip to content

Commit

Permalink
DEV: provides a way to hook into createWidget constructor (#8340)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaffeux committed Nov 13, 2019
1 parent 38a18b7 commit e4df379
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/discourse/widgets/widget.js.es6
Expand Up @@ -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);
Expand All @@ -144,6 +146,8 @@ export default class Widget {
return {};
}

init() {}

destroy() {}

render(prev) {
Expand Down

0 comments on commit e4df379

Please sign in to comment.