Skip to content

Instantly share code, notes, and snippets.

@wbarcovsky
Last active June 21, 2022 15:34
Show Gist options
  • Select an option

  • Save wbarcovsky/a514edf716c2a2e2fad78decf3f7dbd2 to your computer and use it in GitHub Desktop.

Select an option

Save wbarcovsky/a514edf716c2a2e2fad78decf3f7dbd2 to your computer and use it in GitHub Desktop.
class Parent {
constructor(params) {
Object.assign(this, params);
}
static fabric() {
return new Parent({ source: 'fabric', test: 1 });
}
title() {
return "I'm Parent";
}
}
class Children extends Parent {
title() {
return "I'm Children";
}
}
const parent = Parent.fabric();
const children = Children.fabric();
console.log(parent.title(), children.title());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment