How to avoid circular references at the same time create some child classes from the parent class? And keep the constrain that each class need to reside in a different file.
//Parent.mjs:
import Sub from "/.Sub.mjs"
export default class Parent {
static createSomething(){
new Sub();
}
}
//Sub.mjs:
import Parent from "/.Parent.mjs"
export default class Sub extends Parent {
contructor(){}
}
This question was originally posted here. But there is no solution under that question. If I really want to create a subclass from the superclass what code should I write?