mirror of
https://github.com/flarum/framework.git
synced 2025-05-23 15:19:56 +08:00
Add init hook as a way to effectively monkey patch constructors
Related to #246
This commit is contained in:
@ -53,6 +53,16 @@ export default class Component {
|
||||
* @public
|
||||
*/
|
||||
this.element = null;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the component is constructed.
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
init() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user