refactor: Trait::initialize
This commit is contained in:
parent
f6145f99f1
commit
5e8805fde1
|
@ -34,8 +34,6 @@ export class Trait {
|
|||
|
||||
destroy() {}
|
||||
|
||||
hasInitialized() {}
|
||||
|
||||
hooks() {
|
||||
return {};
|
||||
}
|
||||
|
@ -44,6 +42,8 @@ export class Trait {
|
|||
return Promise.resolve();
|
||||
}
|
||||
|
||||
initialize() {}
|
||||
|
||||
label() {
|
||||
return this.constructor.name;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class GraphicalBase extends Trait {
|
|||
this.trackPosition = this.params.get('trackPosition');
|
||||
}
|
||||
|
||||
hasInitialized() {
|
||||
initialize() {
|
||||
if (this.shouldSynchronizePosition()) {
|
||||
this.synchronizePosition();
|
||||
}
|
||||
|
|
|
@ -116,8 +116,8 @@ export class Traits {
|
|||
properties[key].instance = instance;
|
||||
this.properties_PRIVATE[key] = properties[key];
|
||||
}
|
||||
// Let the Trait know that it has initialized.
|
||||
instance.hasInitialized();
|
||||
// Let the Trait do its initialization.
|
||||
instance.initialize();
|
||||
// Add state.
|
||||
this._setInstanceState(type, instance);
|
||||
// Track trait.
|
||||
|
|
Loading…
Reference in New Issue
Block a user