-
Notifications
You must be signed in to change notification settings - Fork 0
parent
paige edited this page Sep 20, 2023
·
5 revisions
parent is used in subclasses to get elements from the original class
const Class = require('aepl');
// creates a new class called A
new Class("A", class {
constructor() {
this.data = [1, 2, 3];
}
});
// creates a subclass called B
new A.Class("B", class {
constructor() {
let data = this.parent.data; // gets the data from class A
let last = data[data.length]; // gets the last number from the data
data.push(last+1); // adds 4 to the data
}
});
// creates a new instance of class A
let a = new A();
console.log(a.data); // [1, 2, 3]
// creates a new instanceof class B adding 4 to the data
let b = new a.B();
console.log(a.data); // [1, 2, 3, 4]
If you want to check out the different versions and changes check out the releases
For a look into the development side check out the src folder
init()
from()
inspect()
new()
addClass()
addFunc()
addProp()
addChore()
addAsyncChore()
addPreClass()
addPreFunc()
addPreProp()
addPreChore()
addPreAChore()
setName()
setInspect()
Subclass
Function
Property
Chore
AsyncChore
Preclass
PreFunction
PreProperty
PreChore
PreAsyncChore
compact
multiple-layers
event handler
alternate names
setting and getting inspects