-
Notifications
You must be signed in to change notification settings - Fork 0
Subclass
paige edited this page Sep 25, 2023
·
2 revisions
you can use new x.Class(), new x.Subclass(), new x.SubClass(), or new x.Sub() to create a new sub class
const Class = require('aepl');
// creates a new class named A
new Class("A", class {
constructor() {
this.data = [1, 2, 3];
}
});
// creates a new subclass named B
new A.Class("B", class {
constructor() {
this.data = [4, 5, 6];
}
});
// creates a new instance of A
let a = new A();
console.log(a.data); // [1, 2, 3]
// creates a new instance of B
let b = new a.B();
console.log(b.data); // [4, 5, 6]
description: creates a new subclass
calls:
- Class/class
- SubClass/Subclass/subclass
- Sub/sub
parameters:
- name
String
: name of the subclass- value
Any
: class to create using (usually a class but it can also just be a value)new Class("Example", class { /* class info */ }); new Example.Class("A", class { /* class info */ }); new Example.Class("B", "value"); let example = new Example(); let a = new example.A(); // whatever's in the class let b = new example.B(); // returns "value"
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