We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
this.constructor
1 parent f78491f commit 94d2e18Copy full SHA for 94d2e18
index.js
@@ -1,13 +1,11 @@
1
export class Base {
2
constructor(options = {}) {
3
this.options = options;
4
- // apply plugins
5
- // https://stackoverflow.com/a/16345172
6
- const classConstructor = this.constructor;
7
- classConstructor.plugins.forEach((plugin) => {
+ this.constructor.plugins.forEach((plugin) => {
8
Object.assign(this, plugin(this, options));
9
});
10
}
+
11
static plugin(plugin1, ...additionalPlugins) {
12
var _a;
13
const currentPlugins = this.plugins;
0 commit comments