chore: old junk
This commit is contained in:
parent
14fe561c42
commit
75da3ad9d4
|
@ -1,34 +0,0 @@
|
||||||
```
|
|
||||||
webpack:///../lib/@avocado/packages/entity/trait.js?:29
|
|
||||||
entity.on("".concat(type, ".trait-").concat(traitType), listeners[type], this);
|
|
||||||
```
|
|
||||||
|
|
||||||
This is because you subclassed `Trait` but forgot to pass through the arguments
|
|
||||||
from your subclass constructor to the superclass constructor. Always default
|
|
||||||
to writing your Trait definition like:
|
|
||||||
|
|
||||||
```
|
|
||||||
class MyTrait extends Trait {
|
|
||||||
|
|
||||||
initialize() {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
All trait initialization should be done in `initialize`.
|
|
||||||
|
|
||||||
If you need really need to access arguments in your subclass constructor, opt
|
|
||||||
to pass along `arguments` instead, such as:
|
|
||||||
|
|
||||||
```
|
|
||||||
class MyTrait extends Trait {
|
|
||||||
|
|
||||||
constructor(entity, params, state) {
|
|
||||||
super(...arguments);
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
Loading…
Reference in New Issue
Block a user